While searching, I came across a very similar post here but I have an additional question to what has been posted there already.
id|person_name|department_name|phone_number
--+-----------+---------------+------------
1 |"John" |"Finance" |"023451"
1 |"John" |"Finance" |"99478"
1 |"John" |"Finance" |"67890"
1 |"John" |"Marketing" |"023451"
1 |"John" |"Marketing" |"99478"
1 |"John" |"Marketing" |"67890"
2 |"Barbara" |"Finance" |""
3 |"Michelle" |"" |"005634"
Lets say I want the final result as:
id|person_name|department_name|phone_number
--+-----------+---------------+------------
1 |"John" |"Finance" |"023451", "99478", "67890"
1 |"John" |"Marketing" |"023451", "99478", "67890"
2 |"Barbara" |"Finance" |""
3 |"Michelle" |"" |"005634"
basically similar results from phone_number
concatenated; then can you advise what should I be doing ? I tried GROUP_CONCAT with DISTINCT but it didn't help.