Solved

Simple SQL not exists qns

Posted on 2006-10-27
1
145 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 142

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 35 total points
Comment Utility
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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

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 look for a specific file type in a local or remote server directory using PHP.
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

771 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now