Selecting dates next to each other in Mysql -


been trying figure out while now.

i looking select rows database table in mysql 2 dates next each other.

e.g. 2011-07-20 next 2011-07-21.

many thanks

neil

i guess can join using adddate():

select t1.id, t2.id mytable t1 inner join mytable t2     on t1.date = adddate(t2.date, -1) t1.id < t2.id; 

the where verify t1 , t2 don't contain duplicates.


Comments

Popular posts from this blog

linux - Using a Cron Job to check if my mod_wsgi / apache server is running and restart -

actionscript 3 - TweenLite does not work with object -

jQuery Ajax Render Fragments OR Whole Page -