Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
ckuo@kahluadesigns.com
Yak Posting Veteran
58 Posts |
Posted - 2002-09-16 : 17:18:50
|
| This is probably a simple statement, but it escapes me. How do I return the lowest Price where the productcode is the same. Here is a sample table.PRODUCTSProductID---ProductCode---Price1-----------101-----------1002-----------101-----------1403-----------101-----------904-----------102-----------2005-----------102-----------300I would like to returnProductCode---Price101-----------90102-----------200Thanks. |
|
|
tool
Starting Member
26 Posts |
Posted - 2002-09-16 : 17:26:58
|
| This should do it:SELECT ProductCode, MIN(Price)FROM ProductsGROUP BY ProductCode |
 |
|
|
|
|
|