Posted: 22 September 2006 at 10:02am | IP Logged
|
|
|
im stuck and i need my lovely SFH friends hehe, (hopefully demon will see this he seems to know this kinda stuff (maybe gam gam's).
i have this sql query:
SELECT ROWNUM - 61 AS MONTH, TO_CHAR(ADD_MONTHS(SYSDATE, 1 - 1 * ROWNUM + 60), 'MON YY') AS MONTH_LABEL FROM (SELECT SYSDATE AS DATETODAY FROM DUAL GROUP BY CUBE(1, 2, 3, 4, 5, 6, 7, 8)) DERIVEDTBL WHERE (ROWNUM < 120)
it basically creates a list of dates and index numbers:
-60 SEP 11 -59 AUG 11 -58 JUL 11 -57 JUN 11 -56 MAY 11 -55 APR 11 -54 MAR 11 -53 FEB 11 -52 JAN 11 -51 DEC 10 -50 NOV 10
(this one does negative through to positive)
So the problem is CUBE is only supported by oracle 8.1 and my database doesnt use it, any anyone else think of a way to get this sequence of numbers without using cube.
cheers
|