Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Aliases in Cassandra CQL

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?

like image 223
user2090879 Avatar asked Mar 26 '13 09:03

user2090879


2 Answers

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;

like image 80
Le Duc Duy Avatar answered Oct 23 '22 03:10

Le Duc Duy


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.

like image 37
Lyuben Todorov Avatar answered Oct 23 '22 03:10

Lyuben Todorov