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 |
|
SGB19
Starting Member
10 Posts |
Posted - 2007-03-05 : 11:31:41
|
| Any comment is appreciated and welcome.Here is the table structure for CUSTOMER:CustomerID Name StreetAddress StateZipCode ----------- ----------------------------------------------Here is the table structure for INVOICE:InvoiceNbr InvoiceDt TotalPriceCustomerID EmpID Here is the table structure for INV_LINE_ITEMLineNbr Quantity InvoiceNbr PartNbr StoveNbr ExtendedPrice Here is the table structure for stove:SerialNumber Type Version DateOfManufacture Color EmpId I need to find all the stoves that were never been bought by these customers. I wrote these queries but the projection was wrong.SELECT type+version as 'Stove type/version never purchased by PA customers'from STOVE WHERE SERIALNUMBER IN(SELECT STOVENBRFROM INV_LINE_ITEMWHERE INVOICENBR IN(SELECT INVOICENBRFROM INVOICEWHERE CUSTOMERID IN(SELECT CUSTOMERIDFROM CUSTOMERWHERE STATEPROVINCE = 'pa')));I tried these queries but I did not get the results expected. Any comment is welcome.Thankssgb19***********sg*********** |
|
|
snSQL
Master Smack Fu Yak Hacker
1837 Posts |
Posted - 2007-03-05 : 17:55:26
|
| Duplicate http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=79961 |
 |
|
|
|
|
|