query neededgreenspun.com : LUSENET : SQL Server Database Administration : One Thread |
Hi, I have three tables and i need query lowest price for the product 'AA40' in all cities Product-- ProductID,Name Supplier-- SupplierID,Name,City Poduct_Supplier--ProductID,SupplierID,PriceGenerate a report which outputs the lowest price for the product 'AA40' in all cities thanks jack
-- Anonymous, July 17, 2001
Jack,This works:
select City, min (Price) as Price from Product, Supplier, Product_Supplier where Product.ProductID = 'AA40' and Product.ProductID = Product_Supplier.ProductID and Supplier.SupplierID = Product_Supplier.SupplierID group by City
Hope this helps,
Eric
-- Anonymous, July 17, 2001