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