I\'m sure there is a way to do it but I don\'t know it anymore...
I have one big table with all the data.
In the table I have rows with information
table I
Try this:
SELECT T2.name,T1.groupName FROM Table1 T1 INNER JOIN Table1 T2 on T1.groupID=T2.groupId2 WHERE T2.category=1
Result:
NAME GROUPNAME Paul IT Bob IT An HR
See result in SQL Fiddle