By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,379 Members | 1,380 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,379 IT Pros & Developers. It's quick & easy.

how to query this?

100+
P: 144
hi,

i have three tables:

supplier : supplier_code, supplier name
delivery : supplier_code, product_id, date
product : product_id, product_name


let's say that i have 7 kind of product
how to show the name of the supplier who has delivered all kinds of product?


thank you very much
Apr 18 '08 #1
Share this Question
Share on Google+
1 Reply


100+
P: 152
gpl
The simple solution, showing what product was delivered by which supplier would look like this

Expand|Select|Wrap|Line Numbers
  1. Select DISTINCT
  2.   s.supplier name,
  3.   p.product_name
  4. From supplier s
  5. Inner Join delivery d on s.supplier_code=d.supplier_code
  6. Inner Join product p on d.product_id=p.product_id

"how to show the name of the supplier who has delivered all kinds of product?"
Im not sure quite what you mean by this -- do you mean suppliers who supplied more than one product ?

Graham
Apr 18 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.