SQL subquery or PL/SQL
From: JEFF CHAMBLEE <chamblej_at_author.gsfc.nasa.gov>
Date: Mon, 3 May 1993 19:31:00 GMT
Message-ID: <3MAY199314315099_at_author.gsfc.nasa.gov>
column statement format 99999
column instruction format a35 word_wrapped column location format a6
column obj_code format a8
column symbol format a6
column seq format 99999
Date: Mon, 3 May 1993 19:31:00 GMT
Message-ID: <3MAY199314315099_at_author.gsfc.nasa.gov>
How do you avoid doing that subquery twice?
column statement format 99999
column instruction format a35 word_wrapped column location format a6
column obj_code format a8
column symbol format a6
column seq format 99999
accept LOC number prompt 'Enter memory location: '
select seq, location,loc_abs_rel,obj_code,obj_abs_rel,symbol,instruction
from source_code_lst where seq + 5 >=
(select seq
from source_code_lst where location = &&LOC and loc_abs_rel = 'A') and seq - 5 <=
(select seq
from source_code_lst where location = &&LOC and loc_abs_rel = 'A') order by seq;
undefine LOC
Jeff Chamblee "I'm not very smart, but Computer Sciences Corp. I can lift heavy things."CHAMBLEJ_at_OBCDEV.GSFC.NASA.GOV Received on Mon May 03 1993 - 21:31:00 CEST