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?

Sam R.
  • 16,027
  • 12
  • 69
  • 122
user2090879
  • 683
  • 2
  • 10
  • 16

2 Answers2

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;

Le Duc Duy
  • 1,881
  • 1
  • 19
  • 18
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.

Lyuben Todorov
  • 13,987
  • 5
  • 50
  • 69
  • Thanks a lot for your help ! It seems like Cassandra doesn't support using aliases in queries :/ – user2090879 Mar 26 '13 at 17:49
  • @user2090879 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. – Lyuben Todorov Mar 26 '13 at 18:38