【问题标题】:How to add column description in CREATE TABLE DDL如何在 CREATE TABLE DDL 中添加列描述
【发布时间】:2021-12-31 20:54:36
【问题描述】:

我想将列描述添加到我在 BigQuery 中创建的表中。

当我尝试执行以下查询时:

CREATE TABLE mydataset.newtable (
  x STRING(10) "denotes value of x",
  y STRING(10) "denotes value of y",
  z BIGNUMERIC(35) "denotes value of z"
) AS (SELECT x, y, z FROM table2)

我收到一个错误:

语法错误:应为“)”或“”,但得到字符串文字“表示 x 的值”

我错过了什么?

【问题讨论】:

    标签: sql google-bigquery ddl


    【解决方案1】:

    根据the documentation,这应该可以:

    CREATE TABLE mydataset.newtable (
      x STRING(10)     OPTIONS(description="denotes value of x"),
      y STRING(10)     OPTIONS(description="denotes value of y"),
      z BIGNUMERIC(35) OPTIONS(description="denotes value of z")
    )
    

    【讨论】:

      猜你喜欢
      • 2010-12-31
      • 2020-05-26
      • 1970-01-01
      • 1970-01-01
      • 2013-09-26
      • 1970-01-01
      • 2011-05-25
      • 2022-08-19
      • 2019-09-18
      相关资源
      最近更新 更多