Reputation: 1391
id url start end
1 http://yahoo.com 2010-10-17 2010-10-10
2 http://google.com 2010-10-15 2010-12-11
3 http://espan.com 2010-10-20 2011-01-20
4 http://espan.com 2010-10-01 2011-01-01
if Today is 2010-10-16
..
how can I get results work in today.
2 http://google.com 2010-10-15 2010-12-11
4 http://espan.com 2010-10-01 2011-01-01
Upvotes: 0
Views: 56
Reputation: 272006
Something like this?
SELECT *
FROM that_table
WHERE CURRENT_TIMESTAMP BETWEEN start AND end
Note that:
Upvotes: 1
Reputation: 4043
SELECT * FROM your_table WHERE CURDATE() >= start AND CURDATE() <= end
Upvotes: 2
Reputation: 10327
SELECT id, url, start, end
FROM Your_Table
WHERE 2010-10-16 BETWEEN start AND end
Replace 2010-10-16
with CURRENT_TIMESTAMP or equivalent in MySQL
Upvotes: 2