11智能在线
新记
在数据库中查询一段时间内的数据,SQL语句怎么写
如题所述
举报该文章
相关建议 推荐于2017-12-16
例:查询table表中,时间(time)在2016年5月1日之后的数据:
select * from table where to_char(time,'yyyy-mm-dd')>'2016-05-01';
注:to_char()函数适用于orcle数据库,如果你用的是mysql数据库,把to_char()替换成date_format()即可。
温馨提示:内容为网友见解,仅供参考
当前网址:
https://11.t2y.org/zz/f4qvv4277p8vp8mm8qq.html
其他看法
无其他回答
相似回答
在数据库中查询一段时间内的数据,SQL语句怎么写
答:
例:查询table表
中,时间
(time)在2016年5月1日之后
的数据
:select * from table where to_char(time,'yyyy-mm-dd')>'2016-05-01';注:to_char()函数适用于orcle数据库,如果你用的是my
sql数据库,
把to_char()替换成date_format()即可。
大家正在搜
数据库中修改数据语句
数据库添加数据语句
数据库删除数据语句
数据库改数据sql语句
数据库清空表数据语句
数据库查询语句
创建数据库的sql语句
修改数据库的sql语句
数据库语句
相关问题
在数据库中查询一段时间内的数据,SQL语句怎么写
SQL语句查询特定时间段的数据怎么写
怎么查询一段时间内的数据,SQL语句怎么查询
SQL语句查询时间段的数据命令语句怎么样写
mongodb数据库怎么查询出某一段时间内的数据?
如何在SQL中按时间段查询数据
SELECT一段时间的数据的SQL语句怎么写,两个时间之间的
sql数据库中多时间段查询并统计,查询语句怎么写?