티스토리 뷰

🌈 MsSql

CONCAT(Transact-SQL)

James Wetzel 2023. 8. 30. 14:56
728x90
반응형

이 함수는 둘 이상의 문자열 값을 엔드투엔드 방식으로 연결하거나 조인한 결과 문자열을 반환합니다.

SELECT CONCAT ( 'Happy ', 'Birthday ', 11, '/', '25' ) AS Result;

Result  
-------------------------  
Happy Birthday 11/25  
  
(1 row(s) affected)

 

실전 예제

select string_agg(concat(pis.sku_no, '(', pis.sku_qty, ')'), ', ')
from table_name as pis with(nolock)
728x90
반응형