SQL Tips and Tricks
Scenario when we need to filter specific select cases with joins
SELECT DISTINCT ProgramID
,STUFF((
SELECT '|' + t1.TrancID
FROM @TBL_ReportColumns T1
WHERE T1.ProgramID = T2.ProgramID
FOR XML PATH('')
), 1, 1, '') AS TransactionCode
--,trancName,tr...
rohit36a.hashnode.dev3 min read