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: SQL Query

RE: SQL Query

From: Paul van Dijken <paul.vandijken_at_sema.nl>
Date: Tue, 3 Oct 2000 09:16:39 +0200
Message-Id: <10638.118364@fatcity.com>


Sorry,

It still doesn't give me the analytes without norm.

Paul

-----Original Message-----
From: Mahmoud Reza Zare [mailto:mrezair_at_0racledba.com] Sent: 03 October 2000 08:45
To: Multiple recipients of list ORACLE-L Subject: Re: SQL Query

You should break your SELECT in two parts , sth like this

select TES.TEST_ID, me.ANALYTE, me.value from (select ANA.ANALYTE, nvl(TO_CHAR(NOR.Value),'NULL') Value, ana.test_id, nor.ns_id
from NORMS NOR, ANALYTES ANA
 WHERE NOR.ANALYTE(+)=ANA.ANALYTE) me, test tes where tes.TEST_ID = me.TEST_ID
and me.NS_ID=TES.NS_ID
AND TES.test_id= 1

Further you may optimize it to

select TES.TEST_ID, me.ANALYTE, me.value from (select ANA.ANALYTE, nvl(TO_CHAR(NOR.Value),'NULL') Value, ana.test_id, nor.ns_id
from NORMS NOR, ANALYTES ANA
 WHERE NOR.ANALYTE(+)=ANA.ANALYTE
      and ana_tes_id (+) = 1 ) me, test tes where tes.TES.TEST_ID = me.TEST_ID
and me.NS_ID=TES.NS_ID


Be someone_at_0racledba.com - get your free mail from Oriole Corporation  http://www.oriolecorp.com - Performance tools for Oracle DBAs

Get email for your site ---> http://www.everyone.net

-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: Mahmoud Reza Zare
  INET: mrezair_at_0racledba.com

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
Received on Tue Oct 03 2000 - 02:16:39 CDT

Original text of this message

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