I have a list of rows with name leader name and manager name but these records are coming after joining few tables
SELECT DISTINCT
(leader.name), manager.Name
FROM
ref, leader, orgList, manager, modules
WHERE
leader.id = orgList.leaderCode
AND orgList.dept = ref.id
AND orgList.manager = manager.id
AND orgList.id = modules.orgListId
AND ref.id = 'xyzzz123'
AND ref.month = 'august'
AND modules.year = '2018'
I get result like this
leader_name manager_name
---------------------------------
John Jim
John Hiko
John Sevu
John Celi
Kerst Newon
Kerst Dollace
But I actually want result like this
leader_name manager_name
------------------------------------
John Jim;Hiko;Sevu;Celi
Kerst Newon;Dollace
I tried pivot and other things but that works only with one table.
JOIN.ON. That doesn't solve your problem, it just brings you up-to-date on SQL syntax.JOINsyntax in the ANSI-92 SQL Standard (more than 25 years ago) and its use is discouraged