Click here to Skip to main content
15,914,416 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
In my table has following fields
ID  Name
1   Devi
1   Devi
2   Raja
2   Raja
3   Rajan
3   Rajan
4   Raja
4   Raja


I want following records
Id  Name
1    Devi
2    Raja
3    Rajan
4    Raja

How to do it help me Please....
Thank you
Posted

Hi ,
Check this
SQL
select distinct ID , Name from [TableName]

Best Regards
M.Mitwalli
 
Share this answer
 
You can use DISTINCT keyword to remove duplicates.
Sample:
SQL
SELECT DISTINCT 
   Id, Name
FROM 
   MyTable ;

Refer: MSDN: Eliminating Duplicates with DISTINCT[^]
 
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