Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Help with sql-query
Ugly code alert - and wouldn't want to debug that.
Surely the elegant (well designed!) solution is a calendar_dates table.....
SELECT * FROM test_tab
1 21/06/2007 24/06/2007 2 23/06/2007 30/06/2007
SELECT *
FROM calendar,
test_tab
WHERE cad_code = 'TESTCAL'
AND cad_date BETWEEN b AND c
TESTCAL 21/06/2007 1 21/06/2007 24/06/2007 TESTCAL 22/06/2007 1 21/06/2007 24/06/2007 TESTCAL 23/06/2007 1 21/06/2007 24/06/2007 TESTCAL 24/06/2007 1 21/06/2007 24/06/2007 TESTCAL 23/06/2007 2 23/06/2007 30/06/2007 TESTCAL 24/06/2007 2 23/06/2007 30/06/2007 TESTCAL 25/06/2007 2 23/06/2007 30/06/2007 TESTCAL 26/06/2007 2 23/06/2007 30/06/2007 TESTCAL 27/06/2007 2 23/06/2007 30/06/2007 TESTCAL 28/06/2007 2 23/06/2007 30/06/2007 TESTCAL 29/06/2007 2 23/06/2007 30/06/2007 TESTCAL 30/06/2007 2 23/06/2007 30/06/2007Received on Thu Jun 21 2007 - 10:02:29 CDT
![]() |
![]() |