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.
我需要在单列中显示 sysdate、sysdate-1 和 sysdate-3。任何人都可以建议一个 SQL 查询来做到这一点(不使用游标,只是简单的 SQL)?
这个怎么样:
SELECT CURDATE() AS date UNION SELECT SUBDATE(CURDATE(), 1) UNION SELECT SUBDATE(CURDATE(), 3)