?
Solved

Simple SQL not exists qns

Posted on 2006-10-27
1
Medium Priority
?
151 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Want to be a Web Developer? Get Certified Today!

Enroll in the Certified Web Development Professional course package to learn HTML, Javascript, and PHP. Build a solid foundation to work toward your dream job!

Question has a verified solution.

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

There are two main kinds of selectors in CSS: One is base selector like h1, h2, body, table or any existing HTML tags.  For instance, the following rule sets all paragraphs (<p> elements) to red: (CODE) CSS also allows us to define our own custom …
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 …
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
The viewer will learn how to dynamically set the form action using jQuery.
Suggested Courses

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