CONCAT

Description

The CONCAT function concatenates two expressions and returns the resulting expression. (RedShift SQL Language References CONCAT function).

Grammar Syntax

CONCAT ( expression1, expression2 )

This function is fully supported by Snowflake.

Sample Source Patterns

Input Code:

IN -> Redshift_01.sql
CREATE TABLE test_concat_function (
    col1 varchar
 );

INSERT INTO test_concat_function
VALUES ('name');

SELECT  CONCAT(col1, ' TEST '),
        "CONCAT"(col1, ' TEST '),
        col1 || ' TEST ' 
FROM test_concat_function;

Output Code:

OUT -> Redshift_01.sql
CREATE TABLE test_concat_function (
    col1 varchar
 )
COMMENT = '{ "origin": "sf_sc", "name": "snowconvert", "version": {  "major": 0,  "minor": 0,  "patch": "0" }, "attributes": {  "component": "redshift",  "convertedOn": "11/20/2024",  "domain": "test" }}';

INSERT INTO test_concat_function
VALUES ('name');

SELECT  CONCAT(col1, ' TEST '),
        CONCAT(col1, ' TEST '),
        col1 || ' TEST '
FROM
        test_concat_function;

There are no known issues.

Last updated