oracel吗?如果是的话,你的语法不对
SELECT DATEDIFF(DAY, date1, date2) AS day_diff
FROM table_name;
-----------------------
---------------------也可以用下面的方法------------------
SELECT (TO_DATE(‘2022/05/20’, ‘YYYY/MM/DD’) – TO_DATE(‘2022/05/10’, ‘YYYY/MM/DD’))/86400 AS day_diff FROM dual;