I want to only group by the second column so there are no duplicates:
ID | Name
__________
1 | Test1
2 | Test2
3 | Test3
4 | Test2
5 | Test1
6 | Test4
So I only want to show:
ID | Name
__________
1 | Test1
2 | Test2
3 | Test3
6 | Test4
I tried using Distinct and group by with no success
This should work using the MIN aggregate:
SELECT MIN(ID), Name
FROM YourTable
GROUP BY Name
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With