简体   繁体   English

BigQuery SELECT NULL AS“some_name”:意外的字符串文字

[英]BigQuery SELECT NULL AS "some_name" : Unexpected String Literal

I would like to set a string column as NULL in BigQuery with the query我想在 BigQuery 中使用查询将字符串列设置为 NULL

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

But I get the error Syntax error: Unexpected string literal "h3-2" at [1:16]但我收到错误Syntax error: Unexpected string literal "h3-2" at [1:16]

How do I set a column as NULL?如何将列设置为 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问题确实是使用字符串文字。我添加了引号,因为 h3-2 也没有工作,但我不得不这样做

SELECT NULL AS h3_2
 FROM `sometable` LIMIT 10

to get it to work让它工作

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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