Select ID --the id field
From tblAds --the ads table
WHERE Ad_Date >= DATEADD(day,-3,getDate()) --the filter. I am assuming Ad-Date is the name of the ad's date field
order by Ad_Date ASC -- order it
于 2013-02-09T07:27:12.970 回答
This answer is useful
1
对于 Oracle DB,使用这个,
SELECT id
FROM tablename
WHERE TRUNC(pdate) >= TRUNC(SYSDATE) - 3;