SQL中时间的加减法

来源:这里教程网 时间:2026-03-02 10:02:27 作者:
SQL中时间的加减法[@more@]

-declare @temp datetime
set @temp = getdate();
select @temp
select dateadd(m,-9, @temp)

参数 m的可以被下面的值代替:
yyyy 年
q 季
m 月
y 一年的日数
d 日
w 一周的日数
ww 周
h 时
n 分钟
s 秒

相关推荐