📜  mysql 将变量设置为今天的日期 - SQL 代码示例

📅  最后修改于: 2022-03-11 15:04:59.460000             🧑  作者: Mango

代码示例1
SELECT CAST(CURRENT_DATE() AS CHAR(50)) INTO @today;
SELECT CAST(DATE_ADD(CURRENT_DATE, INTERVAL -1 DAY) AS DATE) INTO @yesterday;

SELECT @today, @yesterday