12
USE users_tracking;
SELECT user_name FROM visits
where port_name IN 
(SELECT port_name FROM ports where location = 'NY' )//as temp;

It gives an error mismatched input 'SELECT' expecting RULE_T_R_PAREN

Is there any way I can store the inner query in a variable and then use that? I tried using set@varname := query but it does not recognize the set command.

Community
  • 1
  • 1
pizzaEatingGuy
  • 878
  • 3
  • 10
  • 19

1 Answers1

14

Nested queries are not allowed in Cassandra CQL. For this kind of complex querying feature you'll need to use Hive or SparkSQL.

Here is a full CQL reference, http://cassandra.apache.org/doc/cql3/CQL.html

RussS
  • 16,476
  • 1
  • 34
  • 62