Kumar Ravishankar

Kumar Ravishankar

  • NA
  • 437
  • 7.9k

Select comma separated value from multiple column

Apr 15 2019 4:07 AM
I need to select value with comma separated from more than one column.
But need to Ignore if value is NULL
this needs to be done in SQL SERVER 2008.
and getting result like
, THE PINNACLE, BUT need to ignore if value IS null (No need of extra comma)
SELECT TOP 100 ISNULL(BuildingNo, '') + isnull(BuildingName, '') AS AddressLine1
,COALESCE(BuildingNo + ', ', '') + COALESCE(BuildingName + ', ', '') AS AddressLine1
,*
FROM v_AddressList VL
Getting result like 
, THE PINNACLE,  : with extra , in first if value is null 
 

Answers (1)