Basically I need to find all the ids with more than 1 name
so the output should be
(2,a)(2,b)(4,a)(4,b)(4,c)
id name
1 a
2 a
2 b
3 c
3 c
4 a
4 b
4 c
I got a query working
select * from (select distinct * from test) t group by t.id having count(*) > 1
But I think there might be a simpler solution, so yeah, is there a simply solution, if yes, what is it? Thank in advance.
1 Answer