Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
pavelushakov
Starting Member
3 Posts |
Posted - 2008-01-21 : 19:57:42
|
Hello,I've tried searching but couldn't find an answer.Basically I'm trying to create a query for customers that have not ordered from the store.There are two database tables; Customers and Orders.If you can provide any guidance I would be forever grateful.Thank you Pavel |
|
rmiao
Master Smack Fu Yak Hacker
7266 Posts |
Posted - 2008-01-21 : 20:01:59
|
What are table schemata? |
 |
|
pavelushakov
Starting Member
3 Posts |
Posted - 2008-01-21 : 20:08:35
|
customers-----------customeridnameemailorders-----------orderidcustomeridtaxdeliverytotalpaymentype |
 |
|
singularity
Posting Yak Master
153 Posts |
Posted - 2008-01-21 : 21:35:46
|
Try this:select * from customers aleft join orders b on a.customerid = b.customeridwhere b.customerid is null |
 |
|
pavelushakov
Starting Member
3 Posts |
Posted - 2008-01-21 : 22:02:18
|
Thank you very much sir, that worked perfectly. |
 |
|
|
|
|