Solved

Simple SQL not exists qns

Posted on 2006-10-27
1
148 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 35 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

It's sometimes a bit tricky to use date functions in Oracle BPEL. I'll explain quickly how you can add N days to the current date. In a BPEL process this can be useful, and you can adapt it to fit your needs. First of all, let's see how to add 1 …
What is Node.js? Node.js is a server side scripting language much like PHP or ASP but is used to implement the complete package of HTTP webserver and application framework. The difference is that Node.js’s execution engine is asynchronous and event…
The viewer will learn how to dynamically set the form action using jQuery.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

839 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