在数据库中查询一段时间内的数据,SQL语句怎么写

如题所述

例:查询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()即可。
温馨提示:内容为网友见解,仅供参考
无其他回答