0
点赞
收藏
分享

微信扫一扫

Mysql和Oracle获取当天数据的sql语句


Mysql:

select * from 表名 t where DATE_FORMAT(t.时间字段, '%Y-%m-%d') = DATE_FORMAT(now(), '%Y-%m-%d')

Oracle:

select * from 表名 t where TRUNC(t.时间字段) = (select trunc(sysdate) from dual)

 

举报

相关推荐

0 条评论