简体   繁体   中英

BigQuery SELECT NULL AS "some_name" : Unexpected String Literal

I would like to set a string column as NULL in BigQuery with the query

SELECT NULL AS "h3-2"
 FROM `sometable` LIMIT 10

But I get the error Syntax error: Unexpected string literal "h3-2" at [1:16]

How do I set a column as NULL?

The problem was indeed using a string literal.. I added the quotes because h3-2 also wasn't working but instead I had to do

SELECT NULL AS h3_2
 FROM `sometable` LIMIT 10

to get it to work

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM