1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
|
WITH matable AS (
SELECT to_date('260707','ddmmyy') AS sdate FROM dual
UNION ALL
SELECT to_date('160807','ddmmyy') AS sdate FROM dual
UNION ALL
SELECT to_date('170807','ddmmyy') AS sdate FROM dual
UNION ALL
SELECT to_date('170807','ddmmyy') AS sdate FROM dual
UNION ALL
SELECT to_date('100807','ddmmyy') AS sdate FROM dual
UNION ALL
SELECT to_date('200807','ddmmyy') AS sdate FROM dual
UNION ALL
SELECT to_date('200807','ddmmyy') AS sdate FROM dual
UNION ALL
SELECT to_date('280807','ddmmyy') AS sdate FROM dual
UNION ALL
SELECT to_date('300807','ddmmyy') AS sdate FROM dual
UNION ALL
SELECT to_date('120607','ddmmyy') AS sdate FROM dual
UNION ALL
SELECT to_date('140807','ddmmyy') AS sdate FROM dual)
SELECT sdate
FROM matable
WHERE trunc(sdate, 'DD') < trunc(SYSDATE, 'dd')
AND trunc(sdate, 'dd') >= trunc(add_months(SYSDATE, -1),'DD')
16/08/2007
17/08/2007
17/08/2007
10/08/2007
20/08/2007
20/08/2007
28/08/2007
14/08/2007 |
Partager