Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

sql question

Status
Not open for further replies.

MrDontKnowNothing

Programmer
Jun 26, 2003
94
DE
hi folks,

how can i obtain all records, wich are in table "A" and not in table "B"?

(select * from A where A.key not in (select B.key from B))

gracias

alex
 
Were the examples in the Help file not answering your request?

Code:
SELECT customer.company, orders.order_id, orders.emp_id ;
   FROM customer, orders ;
   WHERE customer.cust_id = orders.cust_id ;
UNION ;
   SELECT customer.company, 0, 0 ;
   FROM customer ;
   WHERE customer.cust_id NOT IN ;
   (SELECT orders.cust_id FROM orders)

Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top