0

I have a query in MySQL which is using group_concat. I want to convert it into a SQL Server query.

select 
    apj.package_id, 
    group_concat(DISTINCT concat(asset.asset_id, '-', asset.name) SEPARATOR '||')'asset_names'
from 
    stg.asset_package_join apj (NOLOCK), stg.asset asset (NOLOCK) 
where 
    asset.id = apj.asset_id 
group by 
    apj.package_id

Could you please help me?

ramu
  • 121
  • 1
  • 13
  • [Bad habits to kick : using old-style JOINs](https://sqlblog.org/2009/10/08/bad-habits-to-kick-using-old-style-joins) - that old-style *comma-separated list of tables* style was replaced with the *proper* ANSI `JOIN` syntax in the ANSI-**92** SQL Standard (**more than 20 years** ago) and its use is discouraged – marc_s Feb 24 '16 at 12:08
  • Hi Krishnraj, I am using sql server 2012. – ramu Feb 24 '16 at 12:16

0 Answers0