SQL Server Table Structure as follows
-------------------
1. CompanyID int,Branches varchar(100)
1. Data for above table is
------------------------------
1 '1,2,3'
2 '2,3'
3 '1,3'
2. BranchID int,BranchName varchar(100)
2. Data for above table is
------------------------------
1 'Sydney'
2 'New York'
3 'Los Angeles'
Q. Required Result from 1st table as without using scalar function
---------------------------------------------------------------
1 'Sydney,New York,Los Angeles'
2 'New York,Los Angeles'
3 'Sydney,Los Angeles'