Oracle查询语句参考

1:从昨天下午10点到今天下午十点的数据,查询条件:WHERE 时间字段 BETWEEN (select  trunc(sysdate-1)+22/24 from dual) AND  (select  trunc(sysdate)+22/24 from dual)

2:代表 1天 当前时间往后推迟 1天,select sysdate+1 from dual;

3:trunc函数是 oracle的截取函数,对sysdate取整,select trunc(sysdate) from dual;  

4:取数据库的时间 往后推迟 一个小时,在往后推迟 3天,select trunc(sysdate)+1/24 +3 from dual;  

posted @ 2020-07-02 22:50  有翅膀的大象  阅读(146)  评论(0编辑  收藏  举报