how to query this?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • thesti
    New Member
    • Nov 2007
    • 144

    #1

    how to query this?

    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
  • gpl
    New Member
    • Jul 2007
    • 152

    #2
    The simple solution, showing what product was delivered by which supplier would look like this

    Code:
    Select DISTINCT
      s.supplier name,
      p.product_name
    From supplier s
    Inner Join delivery d on s.supplier_code=d.supplier_code
    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

    Comment

    Working...