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

actionscript 3 - TweenLite does not work with object -

php - How can I edit my code to echo the data of child's element where my search term was found in, in XMLReader? -

c# - Global Variables vs. ASP.NET Session State -