求一句sql(如何select出从今天算起到前7天之间的所有记录)
如何select出从今天算起到前7天之间的所有记录
------解决方案--------------------select *,DATEDIFF(day, yourdate, getdate()) as a from table1 where a <7
------解决方案--------------------select *
from 表名
where datediff( "d ",rq,date()) between 0 and 6