SQL日期和时间函数实例讲解

select getdate();取当前时间

select day(getdate());取当前日

select month(getdate());取当前月

select year(getdate());取当前年

select datediff(day/month/year,’2018-01-28′,’2018-06-29′);取时间差

 和夏晶152天

select dateadd(day ,157,getdate());添加日期时间

(0)
上一篇 2022年3月21日
下一篇 2022年3月21日

相关推荐