在表中增加一个字段date,存数据存入时间,sql语句查询时这样:select * from tableName where date < '2002-1-12';其中后面的日期即本机现在的日期减去7天。
time表示什么,如果是表示数据插入时间,那么select * from table_name where time<=sysdate-7 and state = '未回单'
MYSQL: select * from `order` a where state='未回单' and datediff(now(),time)>7;
什么数据库? time字段是什么
oracle: select * from tbl where time<=trunc(sysdate-7) and state ='未回单';--精确到时分秒 select * from tbl where time<=trunc(sysdate)-7 and state ='未回单';--从当天00:00:00算起7天前
MYSQL:
select * from `order` a
where state='未回单' and datediff(now(),time)>7;
time字段是什么
select * from tbl where time<=trunc(sysdate-7) and state ='未回单';--精确到时分秒
select * from tbl where time<=trunc(sysdate)-7 and state ='未回单';--从当天00:00:00算起7天前