Aliases in Cassandra CQL
Asked Answered
S

2

5

My question is about using aliases in CQL queries.
For example in SQL we can write:

SELECT p.name FROM Persons as p  

Is there something similar in CQL?

Sobersided answered 26/3, 2013 at 9:26 Comment(0)
T
1

When I browsed through the documentation of CQL3 I didn't find any reference to using the as alias.

I'd advise you to have a read through datastax's documentation on what the SELECT statement can and cant do in `CQL 3.

Terrel answered 26/3, 2013 at 12:52 Comment(2)
Thanks a lot for your help ! It seems like Cassandra doesn't support using aliases in queries :/Sobersided
@Sobersided Dont forget, CQL is still fairly new and its feature set is growing rapidly! Perhaps you can propose the 'as' alias to be a future feature in the CQL select statement.Terrel
U
8

From cassandra 2.0, CQL 3 supports aliases in SELECT

http://www.datastax.com/dev/blog/cql-in-cassandra-2-0

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

Undenominational answered 6/8, 2013 at 13:0 Comment(0)
T
1

When I browsed through the documentation of CQL3 I didn't find any reference to using the as alias.

I'd advise you to have a read through datastax's documentation on what the SELECT statement can and cant do in `CQL 3.

Terrel answered 26/3, 2013 at 12:52 Comment(2)
Thanks a lot for your help ! It seems like Cassandra doesn't support using aliases in queries :/Sobersided
@Sobersided Dont forget, CQL is still fairly new and its feature set is growing rapidly! Perhaps you can propose the 'as' alias to be a future feature in the CQL select statement.Terrel

© 2022 - 2024 — McMap. All rights reserved.