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 |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2002-11-26 : 08:32:57
|
| kopi writes "sample table:productNumber productName1 prod12 prod13 prod34 prod35 prod5I would like to select the rows where productName is uniqueThis is what I want to seeproductNumber productName1 prod13 prod35 prod5What would be the select statementThanksKopi" |
|
|
SamC
White Water Yakist
3467 Posts |
Posted - 2002-11-26 : 08:39:25
|
| Try:SELECT DISTINCT productName, productNumberSam |
 |
|
|
ValterBorges
Master Smack Fu Yak Hacker
1429 Posts |
Posted - 2002-11-26 : 08:41:52
|
| SELECT MIN(ProductNumber), ProductNameFROM ProductsGROUP BY ProductName |
 |
|
|
SamC
White Water Yakist
3467 Posts |
Posted - 2002-11-26 : 10:07:56
|
I'm curious to know if you need the ProductNumber for a DISTINCT productName? If you do, do you need the Min, Max or Avg for a distinct productName? Sam |
 |
|
|
|
|
|