Reputation: 3559
if my databse table is like::
id name
1 Mani
1 Manish
2 mani
2 manish
3 abcd
4 efgh
now i want to lik::
id name 1 Manish 2 manish 3 abcd 4 efgh
(I need to distinct value of id and last row value of name by sql query)
Upvotes: 0
Views: 567
Reputation: 741
select id, MAX(name) name
from YourTable
group by id
IF that´s doesn't matter it.
Upvotes: 1