我需要获取从现在开始的最近10天数据。
我目前有以下Oracle SQL查询语句以获取最近的10个日期。
WITH DATES AS (
SELECT sysdate - 10 AS value_date FROM dual
UNION
SELECT sysdate - 9 AS value_date FROM dual
UNION
SELECT sysdate - 8 AS value_date FROM dual
UNION
SELECT sysdate - 7 AS value_date FROM dual
UNION
SELECT sysdate - 6 AS value_date FROM dual
UNION
SELECT sysdate - 5 AS value_date FROM dual
UNION
SELECT sysdate - 4 AS value_date FROM dual
UNION
SELECT sysdate - 3 AS value_date FROM dual
UNION
SELECT sysdate - 2 AS value_date FROM dual
UNION
SELECT sysdate - 1 AS value_date FROM dual
UNION
SELECT sysdate AS value_date FROM dual
UNION
SELECT sysdate + 1 AS value_date FROM dual
但我希望有一种更合适和高效的方法来获取过去10个日期。联合查询看起来相当混乱。 在Oracle SQL中如何实现这个功能?