Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Problem with Decode fuction
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
![]() |
![]() |