I want to retrieve record for distinct value with it's ID ,Table is like this ::
ID Name
1 Soap
2 eridu
3 Soap
4 rewfig
5 Soap
Now I want result:
ID Name
1 Soap
2 eridu
3 rewfig
I use like this: [Table Name is tblRecord
select Distinct(Name) ,ID
from tblRecord
where Name in (select Distinct(Name)
from tblRecord
)