To register for an Internet.com membership to receive newsletters and white papers, use the Register button ABOVE.
To participate in the message forums BELOW, click here

HOME News MS SQL Oracle DB2 Access MySQL PHP Scripts Books Links DBA Talk


Go Back   Database Journal Forums > Related Sites > SQL Course

SQL Course SQL Course > Ask questions about the lessons on SQL Course 1 and 2. If you have problems > with the interface, please post in the Feedback forum

Reply Post New Thread
 
Thread Tools Search this Thread Rate Thread Display Modes
  #1  
Old 12-16-2002, 04:44 PM
curlydog curlydog is offline
Junior Member
 
Join Date: Dec 2002
Posts: 6
Checking If A Value In A Column In One Table Appears In A Column In Another Table

I'm trying to query a database (oracle) which I've created via SQL.

It relates to an ordering system which tracks from a quote to invoicing. Obviously not all quotes are turned into orders. This is what I'm trying to find, which quotes are not ordered.

I have a Quote table with quoteID as the PK. I have another table Order which has a foreign key quoteID which references Quote.

Can anyone tell me how I find the records in Quote which do not appear in Order.

Thanks
CUDOG
Reply With Quote
  #2  
Old 12-18-2002, 04:54 AM
Markus Markus is offline
Member
 
Join Date: Sep 2002
Location: Amsterdam
Posts: 53
Try the following:

SELECT quoteID from quotes
WHERE NOT EXISTS
(SELECT quoteID from Orders
Where orders.quoteid = quote.quoteID)
Reply With Quote
Reply Post New Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 11:38 AM.


DatabaseJournal Recent Articles


 » Searching and Sorting Strings in Oracle

 » Preparing To Upgrade Access Tables to SQL ...

 » Sun Expands MySQL With Closed Source

 » Microsoft Demos New SQL Server Features at...

 » Wipro and Oracle Launch First Joint Innova...

Search Database Journal:
 





Acceptable Use Policy

JupiterOnlineMedia

internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and JupiterOnlineMedia

Jupitermedia Corporate Info


Legal Notices, Licensing, Reprints, & Permissions, Privacy Policy.

Web Hosting | Newsletters | Tech Jobs | Shopping | E-mail Offers

Powered by vBulletin® Version 3.7.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.