Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想getdate()在 SQL SERVER 的结果中增加 2 小时。我知道我可以添加一天:
getdate()
select getdate() + 1
但是,当想要增加小时数时,这是如何完成的getdate()呢?
select dateadd(hour,2,getdate())
Select GETDATE() + (Convert(float,2)/Convert(float,24))
或以其他方式
Select DateAdd(HH,2,Getdate())