【问题标题】:Table Alias in Apache Cassandra / DataStax EnterpriseApache Cassandra / DataStax Enterprise 中的表别名
【发布时间】:2020-11-05 20:51:12
【问题描述】:

是否可以为 Cassandra 中的表设置别名?我们使用的 DataStax Enterprise 版本是 3.2.1

您的帮助将不胜感激。

例如:

 select s from example s where s.id='1234';

【问题讨论】:

    标签: cassandra datastax


    【解决方案1】:

    不幸的是,在 Apache Cassandra 中无法为表设置别名。您可以使用as (reference) 为返回的列名设置别名,即:

    SELECT event_id, dateOf(created_at) as creation_date, blobAsText(content) as content FROM timeline;
    

    但是,您不能为表设置别名。

    【讨论】:

      【解决方案2】:

      您不能在 Cassandra 中为表设置别名。重要的是要了解没有理由在 Cassandra 中为表起别名。当查询涉及多个表(例如连接)时,RDBMS 查询中的表别名很有帮助。这在 Cassandra 中根本不会发生。

      【讨论】:

        猜你喜欢
        • 2018-08-04
        • 2016-01-19
        • 2016-03-21
        • 2015-08-25
        • 2015-01-09
        • 2014-08-17
        • 2014-08-25
        • 1970-01-01
        • 2023-03-10
        相关资源
        最近更新 更多