【问题标题】:Unable to create a table with comment无法创建带有评论的表格
【发布时间】:2018-12-07 05:12:21
【问题描述】:

我正在尝试创建一个表并想在架构中添加注释,但我无法正确获取语法。

CREATE TABLE codingjedi.practice_questions_javascript_tag(
  year bigint,
  month bigint,
  creation_time_hour bigInt,
  creation_time_minute bigInt,
  id uuid,
  PRIMARY KEY ((year, month), creation_time_hour, creation_time_minute)  
) WITH comment = 'some comment' CLUSTERING ORDER BY (creation_time_hour DESC, creation_time_minute ASC) 

【问题讨论】:

    标签: cassandra-3.0 cqlsh


    【解决方案1】:

    我不得不使用AND 来结合这两条指令

    CREATE TABLE codingjedi.practice_questions_javascript_tag(
      year bigint,
      month bigint,
      creation_time_hour bigInt,
      creation_time_minute bigInt,
      id uuid,
      PRIMARY KEY ((year,month), creation_time_hour, creation_time_minute, id )  
    ) WITH comment = 'some comment' AND CLUSTERING ORDER BY (creation_time_hour DESC, creation_time_minute ASC, question_id ASC);
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-06-24
      • 2020-06-26
      • 1970-01-01
      • 1970-01-01
      • 2015-11-20
      • 1970-01-01
      • 2018-04-27
      • 1970-01-01
      相关资源
      最近更新 更多