Please take a look at the query below:
SELECT i.DeviceName, AliasName FROM DeviceInfo i LEFT OUTER JOIN DeviceAliasMapping a ON i.DeviceName = a.DeviceName order by i.DeviceName
DeviceName is returned many times, because in the DeviceAliasMapping table the same DeviceName has many AliasNames
I would like the DeviceName returned only once, and the AliasNames separated by commas in the AliasName column
Can you please let me know how to do it? I appreciate your help.