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.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Multiple table query

Author  Topic 

Ashkan
Starting Member

2 Posts

Posted - 2004-09-03 : 01:04:11
I have three tables: Customer, Product, Ordertbl. I have to list the customer number of customers who have ordered any products manufactured by 'ColorMeg' in 'January 2004'.

SQL> describe ordertbl;
ORDNO ORDDATE CUSTNO

SQL> describe customer
CUSTNO
CUSTFIRSTNAME
CUSTLASTNAME

SQL> describe product
PRODNO
PRODMANUFACTURE

So far I have come up with:

SQL> SELECT CustNo, CustFirstName, CustLastName
2 FROM Customer
3 WHERE CustNo IN
4 (SELECT CustNo
5 FROM OrderTbl
6 WHERE OrdDate LIKE '%-JAN-04');

My problem is I don't know how to narrow my results to the products manufactured by 'ColorMeg'.

Thanks for any help




timmy
Master Smack Fu Yak Hacker

1242 Posts

Posted - 2004-09-03 : 01:07:34
You'd be better off using JOIN's in this case, but how does the product table link to the ordertbl table?
Go to Top of Page

kselvia
Aged Yak Warrior

526 Posts

Posted - 2004-09-03 : 01:22:44
This forum is mainly for SQL Server, not Oracle. Is this a homework assignment?

--Ken
I want to die in my sleep like my grandfather, not screaming in terror like his passengers.
Go to Top of Page

Ashkan
Starting Member

2 Posts

Posted - 2004-09-03 : 01:59:28
Sorry, I didn't know it was a SQL Server forum. It is a question from an assignment I have to complete. I don't want any answers just some guide or direction to complete it. I have attempted it my self but I just got stuck.

Does anyone know any good SQL Oracle forums?
Go to Top of Page
   

- Advertisement -