This topic describes how to use the string function CONCAT in Realtime Compute.

Syntax

 VARCHAR CONCAT(VARCHAR var1, VARCHAR var2, ...)  

Input parameters

Parameter Data type Description
var1 VARCHAR A string.
var2 VARCHAR A string.

Description

Concatenates two or more strings into a new string. If any input parameter is null, the parameter is ignored.

Example

  • Test data
    var1 (VARCHAR) var2 (VARCHAR) var3 (VARCHAR)
    Hello My World
    Hello null World
    null null World
    null null null
  • Test statements
    SELECT CONCAT(var1, var2, var3) as var
    FROM T1;              
  • Test results
    var (VARCHAR)
    HelloMyWorld
    HelloWorld
    World
    N/A