-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Nirmal Kumar Muthu Kumaran
Sent: Tuesday, June 26, 2001 9:01 AM
To: Multiple recipients of list ORACLE-L
Subject: QUERY HELPDear Guru's,
How can i refer the previous record detail(s), when oracle fetchs the current row details?.
sql> SELECT rownum rnum, empno eno, ename FROM EMP;
RNUM ENO ENAME
----------------------------------
1 7369 SMITH
2 7499 ALLEN
3 7521 WARD
4 7566 JONES
7 7782 CLARK
8 7788 SCOTT
10 7844 TURNERIn the above, can i able to put * mark in record 7 and 10, since before these two records, some records are missing.
Is this possible to do this by query. I need this in reports.
Basically my question is,
How can i refer the previous row detail(s), when oracle fetchs the current row details?.Thanks in adv.
REgards,
Nirmal.
Title: QUERY HELP
One
way to do this is in the procedure, use variables that hold the previous values
(e.g. last_rnum := rnum). Then, do your comparison of your current value to your
last stored value (e.g. if rnum - last_rnum >1 then flag='*'). I am sure
there are more than one way to skin a cat on this one--but, I do this for some
processing, and it works fine.
lc
- QUERY HELP Nirmal Kumar Muthu Kumaran
- RE: QUERY HELP Lisa Clary
- RE: QUERY HELP Koivu, Lisa
- RE: QUERY HELP Larry Elkins
- RE: QUERY HELP Daemen, Remco
- Query Help Samar Saxena
- RE: Query Help Naveen Nahata
