Click here to Skip to main content
15,886,724 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hello All,

I have a table like

Id Name
1 Naveen
2 Naveen
3 Kumar
4 Kumar
5 Alex
6 Alex

I want out put like below

Id Name
1 Naveen
3 Kumar
5 Alex

Please help me on this...

I have used Rowcommand() but its not working in sql2000.

How to write a query for this...

Thanks in advance.
Posted

1 solution

Try:
SQL
SELECT MIN(Id) AS Id, Name FROM myTable GROUP BY Name
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900