Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Want only 2 columns distinct
Message
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Title:
Want only 2 columns distinct
Miscellaneous
Thread ID:
00540370
Message ID:
00540370
Views:
62
How do I get a subset of my table where only 2 of the seven fields that I need in the result can be and must be distinct?

select distinct pid,lot from products
(gives the right # of records)

select distinct pid,lot,id,price1,price2,price3,price4,price5,cost
(gives too much distinction even though I need the other fields)

Thanks :)
Next
Reply
Map
View

Click here to load this message in the networking platform