✅ Azure Stream Analytics ✅ Fabric Eventstream
지정한 횟수만큼 문자열 값을 반복합니다.
문법
REPLICATE ( expression , integer_expression )
주장들
표현식
문자 식 또는 nvarchar(max) 형식의 열입니다.
integer_expression
bigint 형식의 식입니다. integer_expression 음수이면 NULL이 반환됩니다.
반환 형식
nvarchar(max)
예시
SELECT
ProductLine,
CONCAT(REPLICATE('0', 4 - LEN(ProductLine), [ProductLine]) AS LineCode
FROM Input
WHERE LEN(ProductLine) = 1
CONCAT 는 null 값을 무시합니다. 4를 초과하면 LEN(ProductLine) 값 손실이 방지됩니다(음수 integer_expression REPLICATE null 반환).
| 제품 라인 | LineCode |
|---|---|
| T | 0000T |
| 1222X | 1222X |
| 99A | 0099A |
| 123456789 | 123456789 |