select convert(varchar(10),getdate(),121) C1, convert(varchar(10),dateadd(month, 1, getdate()), 121) C2, convert(varchar(10),dateadd(month, 1, getdate()+1), 121) C3 C1 C2 C3 ---------- ---------- ---------- 2020-05-27 2020-06-27 2020-06-28 (1 行受影响) 完成时间: 2020-05-27T08:44:43.1865329+08:00
查询当天起 30天内要过期的数据。 这要看 30 天,你是怎么定义的,要不要精确到秒。 建议写成这样的,性能要好(这列 如果加了索引,能用到) where CA_EndDatetime <= getdate() - 30
34,590
社区成员
254,589
社区内容
加载中
试试用AI创作助手写篇文章吧