How to get some of the records but not all of them in a query

Hi there I have a query which returns the events that do not have the mrreceived as 'Y'. Am trying to find a way how we can rewrite the query that gives the events without mrreceived as 'Y" or mrreceived as null but the events with both of the combined?
{code}
select c.client_id,
e.event_id,
e.mrreceived,
e.event_status_code,
e.proj_batch_id,
p.providername,
p.clientproviderid
from event e, client c, clientprovider p
where e.client_id = c.client_id
and e.clientproviderid = p.clientproviderid
and c.client_id = 1250
and p.clientproviderid not in
(select distinct b.clientproviderid from clientprovider b, event x
where b.clientproviderid = p.clientproviderid
and b.clientproviderid = x.clientproviderid
and x.mrreceived = 'Y'
and e.client_id = 1250)
{code}

user11961230 wrote:
i just want to see the id 10371.OK. So you want to see id that has both Y and NULL, right? If so:
select c.client_id,
       e.event_id,
       e.mrreceived,
       e.event_status_code,
       e.proj_batch_id,
       p.providername,
       p.clientproviderid
from   event e, client c, clientprovider p
where  e.client_id = c.client_id
and    e.clientproviderid = p.clientproviderid
and    c.client_id = 1250
and    p.clientproviderid in
       (select b.clientproviderid  from clientprovider b, event x
         where  b.clientproviderid = p.clientproviderid
         and    b.clientproviderid = x.clientproviderid
         and    (x.mrreceived = 'Y' or x.mrreceived IS NULL)
         and    e.client_id = 1250
         group by b.clientproviderid
         having count(distinct nvl(x.mrreceived,'X')) = 2
/SY.

Similar Messages

Maybe you are looking for

  • Network Manager keeps asking for WPA passphrase

    Hi, I finally managed to install arch on my netbook, everything seems to be in working order apart from my wireless connection.. I've installed and configured the broadcom drivers for my card from the AUR and both the access points I usually connect

  • How to calculate  revenue vs taget in obiee11g (running every day)

    hallo masters, i have problem, i have target in 1 year (january until dec) e.g 1000 and then there is revenue every day that calculate until reach 1 year how can i calculate revenue vs target current day (i only have 1 year target, not target daily o

  • LR on two Macs

    I have LR5 installed on my MacBook Pro (16GB Retina, 2.6 i7, 1TB SST), where I store all the pictures as well. Back in my office I connect the MBP to my iMac by thethering the MBP as a harddisk. I then start the LR catalogue through the iMac using th

  • Osdm error 'could not create the Java virtual machine.'

    Running on Windows XP. SQL Developer reports Java(TM) Platform=1.5.0_06 I downloaded and unzipped the osdm early adopter release,but when I double click on the osdm.exe, I get a dialog box titled"Java Virtual Machine Launcher" with the error: could n

  • ILife'11 on MacBook Air 2012

    Hi again, Purchased MBA'2012 last month, its amazing and faster than my old MBP.... Wanted to know how to get access to iLife'11 on App store!! talk to support or there is direct link to register...yadayada. Help appreciated. Cheers