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

Home -> Community -> Usenet -> c.d.o.server -> Re: Problem with Decode fuction

Re: Problem with Decode fuction

From: Daniel Morgan <damorgan_at_x.washington.edu>
Date: Sun, 28 Sep 2003 10:48:35 -0700
Message-ID: <1064771314.840207@yasure>

Tom Miskiewicz wrote:

>Hello!
>
>SELECT DECODE(COUNT(1), 1, 0, NULL) FROM my_table
>WHERE field1 = 'STRING1' AND
>component_type = 'STRING2' AND
>component = 'STRING3' AND
>plant != 'STRING4';
>
>This one works fine, if there is only one record in the table. If there are
>more than one I get a false result. Can someone tell me please how this
>should look like independent on the number of records in the table?
>
>
>Thanks
>Tom
>
>

It would be remarkably helpful if you had included the purpose of this statement. What is it you think it is
supposed to be doing? From my point of view it is remarkably ineffiicient way to do something easily done with EXISTS.

-- 
Daniel Morgan
http://www.outreach.washington.edu/ext/certificates/oad/oad_crs.asp
http://www.outreach.washington.edu/ext/certificates/aoa/aoa_crs.asp
damorgan_at_x.washington.edu
(replace 'x' with a 'u' to reply)
Received on Sun Sep 28 2003 - 12:48:35 CDT

Original text of this message

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