Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我是 HIVE 的新手,我需要从蜂巢中的一张桌子上获取上个月的最后一天。
SQL 等价物 ---
select last_day(add_months(sysdate,-1)) from dual;
我只能在互联网上获得前一天,这就像
select * from table1 where dt >= from_unixtime(unix_timestamp()-1*60*60*24, 'yyyyMMdd');
有人可以帮我查询吗?
谢谢拉克什
try this
DATE_SUB(FROM_UNIXTIME(UNIX_TIMESTAMP()),DAY(FROM_UNIXTIME(UNIX_TIMESTAMP()))) Total MapReduce CPU Time Spent: 1 seconds 850 msec OK 2016-03-31
select date_add(current_date,-day(current_date));