Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> RE: QUERY HELP

RE: QUERY HELP

From: Lisa Clary <lisa_at_cog.ufl.edu>
Date: Tue, 26 Jun 2001 05:42:33 -0700
Message-ID: <F001.00338061.20010626055202@fatcity.com>

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.
<SPAN

class=925285012-26062001> 
<SPAN

class=925285012-26062001>lc

  <FONT face=Tahoma
  size=2>-----Original Message-----From: root_at_fatcity.com   [mailto:root_at_fatcity.com]On Behalf Of Nirmal Kumar Muthu   KumaranSent: Tuesday, June 26, 2001 9:01 AMTo: Multiple   recipients of list ORACLE-LSubject: QUERY HELP   Dear 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 <FONT face=Arial

  size=2>---------------------------------- <FONT face=Arial 
  size=2>1       7369   
  SMITH 2      
  7499    ALLEN <FONT face=Arial
  size=2>3       7521   
  WARD 4      
  7566    JONES <FONT face=Arial
  size=2>7       7782   
  CLARK 8      
  7788    SCOTT <FONT face=Arial
  size=2>10      7844    TURNER   

  In 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, <FONT
  face=Arial size=2>How can i refer the previous row detail(s), when oracle   fetchs the current row details?.
  Thanks in adv.
  REgards, <FONT face=Arial
  size=2>Nirmal. Received on Tue Jun 26 2001 - 07:42:33 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US