SELECT * FROM myTable
WHERE dateCol >= DATE_SUB(NOW(),INTERVAL 1 YEAR) LIMIT 0,1
SELECT * FROM myTable
WHERE dateCol >= DATE_SUB(NOW(),INTERVAL 5 YEAR) LIMIT 0,1
SELECT * FROM myTable
WHERE dateCol >= DATE_SUB(NOW(),INTERVAL 15 MINUTE) LIMIT 0,1
SELECT * FROM myTable
WHERE dateCol >= DATE_SUB(NOW(),INTERVAL 600 SECOND) LIMIT 0,1
WHERE dateCol >= DATE_SUB(NOW(),INTERVAL 1 YEAR) LIMIT 0,1
SELECT * FROM myTable
WHERE dateCol >= DATE_SUB(NOW(),INTERVAL 5 YEAR) LIMIT 0,1
SELECT * FROM myTable
WHERE dateCol >= DATE_SUB(NOW(),INTERVAL 1 MONTH) LIMIT 0,1
WHERE dateCol >= DATE_SUB(NOW(),INTERVAL 1 MONTH) LIMIT 0,1
SELECT * FROM myTable
WHERE dateCol >= DATE_SUB(NOW(),INTERVAL 40 DAY) LIMIT 0,1
WHERE dateCol >= DATE_SUB(NOW(),INTERVAL 40 DAY) LIMIT 0,1
SELECT * FROM myTable
WHERE dateCol >= DATE_SUB(NOW(),INTERVAL 1 HOUR) LIMIT 0,1
WHERE dateCol >= DATE_SUB(NOW(),INTERVAL 1 HOUR) LIMIT 0,1
SELECT * FROM myTable
WHERE dateCol >= DATE_SUB(NOW(),INTERVAL 15 MINUTE) LIMIT 0,1
SELECT * FROM myTable
WHERE dateCol >= DATE_SUB(NOW(),INTERVAL 600 SECOND) LIMIT 0,1
No comments:
Post a Comment