我正在使用下面的命令从配置单元获取过去3个月的数据。从xyz中选择*在“2017-01-06 00:00:00”和“2017-03-06 23:59:59”之间创建;如何在配置单元中获取最近3个月的数据而不使用between关键字。
enxuqcxy1#
如果你的专栏 creat_ts 类型 timestamp 你可以这样写你的查询
creat_ts
timestamp
select * from xyz where from_unixtime(creat_ts) > '2017-01-05' and from_unixtime(creat_ts) < '2017-03-07';
或者如果列的类型为 datetime 或者 date 那么你的问题就是
datetime
date
select * from xyz where creat_ts > '2017-01-05' and creat_ts < '2017-03-07';
希望这会有帮助
1条答案
按热度按时间enxuqcxy1#
如果你的专栏
creat_ts
类型timestamp
你可以这样写你的查询或者如果列的类型为
datetime
或者date
那么你的问题就是希望这会有帮助