gpt4 book ai didi

SQL日期时间更新时间为00 :00:00 from all other time values

转载 作者:行者123 更新时间:2023-12-04 13:09:30 24 4
gpt4 key购买 nike

有没有一种方法可以更新表中的所有列

2010-12-31 23:59:59.000


2010-12-31 00:00:00.000

这样的事情?
UPDATE t1
SET [Posting Date] = [Posting Date] with ms = 00:00:00.000
WHERE ms = other than 00:00:00.000
GO

最佳答案

UPDATE t1
SET [Posting Date] = cast([Posting Date] as date)
WHERE cast([Posting Date] as time) > '00:00'

关于SQL日期时间更新时间为00 :00:00 from all other time values,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19562577/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com