
sysdate -A.date s
from A
where sysdate-A.date in (1,2,...10)
order by s asc
直接 使用date 代替你那个时间了 表使用A代表了
仅仅是我的思路 欢迎共同讨论
例:查询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()即可。
update 表名 set 列名=date_add(列名,interval 10 day) where 条件mssql里时间类型是可以直接加的,不知道mysql行不行,这样保险点,希望能够帮助到你。。。欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)