A表
today
2006-1-1
2006-1-2
2006-10-1
2006-10-2
2006-5-1
根据A表中的数据写一条sql语句查询出如下结果:
today nextday
2006-1-1 2006-1-2
2006-10-1 2006-10-2
简单的题目都把我难倒,痛苦。。。
下面是QQ朋友帮我想的办法:
解决办法:1。select a.today as today ,b.today as nextdate from A a join A b on b.today -a.today =1
2。select a.today,b.today as nextdate from A a,A b where a.today=b.today-1