sql时间相加问题.速度
表
id date timelimit
1 2006-06-06 7
2 2006-06-06 5
用SQL语句,根据已知时间date和期限timelimit值得到最终时间
结果如下:
id date timelimit date2
1 2006-06-06 7 2006-06-13
2 2006-06-06 5 2006-06-11
------解决方案--------------------select id,date,timelimit,dateadd(dd,timelimit,date) as date2 from 表
------解决方案--------------------select *,dateadd(day,timelimit,date) as date2 from 表
------解决方案--------------------select *,dateadd(day,timelimit,date) as date2 from 表
--------------------
dateadd(day,timelimit,date)--使列date在day级别上增加timelimit天