?
Solved

Simple SQL not exists qns

Posted on 2006-10-27
1
Medium Priority
?
153 Views
Last Modified: 2012-05-05
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!
0
Comment
Question by:FYPJ
1 Comment
 
LVL 143

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 140 total points
ID: 17817564
the query looks fine so far, anything not working?

or are you looking for this:

select id from SeekAuthorization
where status <> 'R'
and submitted = 'N'
and userID = 'Tony'
and conType = 'mc'
order by id ASC

0

Featured Post

Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Most of the sites are being standardized with W3C Web Standards. W3C provides lot of web standard services to the web. They have the web specification, process and documentation for all the web standards. You can apply HTML, CSS and Accessibility st…
Introduction Knockoutjs (Knockout) is a JavaScript framework (Model View ViewModel or MVVM framework).   The main ideology behind Knockout is to control from JavaScript how a page looks whilst creating an engaging user experience in the least …
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question