Link to home
Start Free TrialLog in
Avatar of FYPJ
FYPJ

asked on

Simple SQL not exists qns

Hi,

just a simple question here. I need to select a set of ids from my table where the status is != 'R'. I have 4 types of status: P,A,N and R.

 How do i go about doing it? Here is my SQL:

select id from SeekAuthorization
where not exists
(
select id from SeekAuthorization where status = 'R'
and submitted = 'N'
and userID = 'Tony'
and conType = 'mc'
)
and submitted = 'N'
and userID = 'Tony'
and conType = 'mc'
order by id ASC

Thanks!
ASKER CERTIFIED SOLUTION
Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial