1. We have moved to a new forum! There may be a few things not working properly so please let us know if you find a bug. Remember to use the bbCode [ sql ] tag for SQL statements.

How to find suppliers that sell all product or more than 1 product ?

Discussion in 'SQL - Questions and Answers' started by adiboy, Jul 5, 2007.

  1. adiboy New Member

    There is 3 tables:
    supplier (sid, name, address)
    product (pid, productname)
    catalog (pid, sid, price)

    i want to know how to show suppliers that sell more than 1 product or maybe sell all product and how to find suppliers that have top 10 cheapest price.

    thanks
    adi.
  2. Unregistered Guest

    Hi

    Try below query.I haven't tested,but I think it will work

    SELECT DISTINCT TOP (10) supplier.name,catalog.price
    FROM supplier INNER JOIN
    catalog ON supplier.sid = catalog.sid
    ORDER BY catalog.price

Share This Page