| SQL - Questions and Answers Have a SQL question? Post it here. First do a search to see if someone hasn't already answered it. |
|
||||||
![]() |
|
|
LinkBack | Thread Tools | Search this Thread |
|
|||
How to find suppliers that sell all product or more than 1 product ?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. |
|
|||
|
Quote:
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 |