Friday, February 15, 2013

Concatenate Columns in SQL


In this way we can concatenate two columns in SQL:

  SELECT 
  
  CONVERT(NVARCHAR(50),[COLUMN_1] 
  + '-'+ 
  CONVERT(NVARCHAR(50),[COLUMN_2])) AS COMBINED 
  
  FROM [TABLE_1]
  WHERE [COLUMN_1] = 'SOME_THING'

No comments:

Post a Comment