Vincent
Vincent

Reputation: 1604

How to SELECT COL_"NAME" in Snowflake ? (COLUMN name containing double quote)

I know this is very bad naming practice, but I am not the owner of the table...

I need to run :

SELECT COL_"NAME"
FROM TABLE

where COL_"NAME" is the name of the column, containing double quotes.

I tried :

SELECT COL_""NAME""
FROM TABLE

SELECT COL_\"NAME\"
FROM TABLE

But nothing works

Upvotes: 1

Views: 1102

Answers (1)

Lukasz Szozda
Lukasz Szozda

Reputation: 175726

Identifier Requirements:

To use the double quote character inside a quoted identifier, use two quotes.

To access column: COL_"NAME"

SELECT "COL_""NAME"""
FROM TABLE;

Upvotes: 2

Related Questions