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 sql-statement

Re: problem with sql-statement

From: Ed Stevens <nospam_at_noway.nohow>
Date: Wed, 07 May 2003 14:54:49 -0500
Message-ID: <k8oibvoehtsk9aae6u0fodvsledb9kl2j6@4ax.com>


On 7 May 2003 10:40:32 -0700, oratune_at_msn.com (David Fitzjarrell) wrote:

>henner.hucke_at_rolls-royce.com (Henner Hucke) wrote in message news:<f6796be6.0305070509.2882672f_at_posting.google.com>...
>> Hello,
>>
>> I have a problem with the following SQL-Statement:
>> (Oracle 8.1.7.4 on Solaris 2.6)
>>
>> If I run
>> select mbd_number from M10000 where
>> (
>> UPPER(MBD_WORKFLOWEBENE) = 'AUSSTELLER'
>> AND
>> MBD_AUSSTELLER_STNR = '000000'
>> )
>> OR
>> (
>> UPPER(MBD_FEHLERGRUPPE) = 'AUSSTELLER'
>> AND
>> MBD_AUSSTELLER_STNR = '000000'
>> AND
>> UPPER(MBD_WORKFLOWEBENE) = 'AUSSTELLER'
>> )
>> I get 'no rows selected'
>>
>> If I run
>>
>> select mbd_number from M10000 where
>> (
>> UPPER(MBD_WORKFLOWEBENE) = 'AUSSTELLER'
>> AND
>> MBD_AUSSTELLER_STNR = '000000'
>> )
>>
>> I get one row presented.
>>
>> I have no idea where my error is.
>> Please can someone help me?
>> Thanks.
>
>
>Look at both queries again, CLOSELY. Apparently no records in your
>table match the following criteria: UPPER(MBD_WORKFLOWEBENE) =
>'AUSSTELLER'. Also note that condition is MISSING from your latter
>query. I think you've now found the cause of your dilemma.
>
>David Fitzjarrell

David,

PMFJI, but I was looking at this (before peeking at the answer) as a bit of a homework exercise and must admit that I'm not seeing it. Here's what I see when I try to simplify it a bit. Please tell me what I'm overlooking:

Query 1 returns no rows:

select <row> from <table>
where (<compound condition 1>)

                    OR
            (<compound condition 2>)

Query 2 returns one row:

select <row> from <table>
where (<compound condition 1>)

Looks to me that if a row satisfied <compound condition 1> in the second query, it would have satisfied it in the first query, making the OR (<compound condition 2>) superflous in that case. Received on Wed May 07 2003 - 14:54:49 CDT

Original text of this message

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