You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by Tony Anecito <ad...@yahoo.com> on 2013/07/04 23:53:47 UTC

CQL and IN

Hi All,
 
I am using the DataStax driver and got prepared to work. When I tried to use the "IN" keyword with a SQL it did not work. According to DataStax IN should work.
 
So if I tried:
 
Select * from items Where item_id IN (Select item_id FROM users where user_id = ?)
 
 
Thanks for the feedback.
-Tony

Re: CQL and IN

Posted by Tony Anecito <ad...@yahoo.com>.
Thanks Petrov I will read what you sent a link to. I am trying to find out what capability CQL wise is truely available in order to determine my end state for my data model.
 
Last night after I discovered the cashing issues that affected queries I was able to create two queries one to get a list of ids then from that built up the IN list for the second query to get detail data from a master column family. Prevously in SQL Server I would use one query using IN and nested select. Hopefully tonight I will be able to compare the performance of the two.
 
Regards,
-Tony
 
 

From: Oleksandr Petrov <ol...@gmail.com>
To: user@cassandra.apache.org 
Sent: Monday, July 8, 2013 5:51 AM
Subject: Re: CQL and IN



Hi Tony, you can check out a guide here: http://clojurecassandra.info/articles/kv.html which explains pretty most of things you need to know about queries for starters.  

It includes CQL code examples, just disregard Clojure ones, there's nothing strictly Clojure-driver specific in that guide.



On Fri, Jul 5, 2013 at 12:18 AM, Rui Vieira <ru...@googlemail.com> wrote:

You can use the actual item_ids however,  
>
>
>Select * from items Where item_id IN (1, 2, 3, ..., n)
>
>
>
>On 4 July 2013 23:16, Rui Vieira <ru...@googlemail.com> wrote:
>
>CQL does not support sub-queries.
>>
>>
>>
>>On 4 July 2013 22:53, Tony Anecito <ad...@yahoo.com> wrote:
>>
>>Hi All,
>>>
>>>I am using the DataStax driver and got prepared to work. When I tried to use the "IN" keyword with a SQL it did not work. According to DataStax IN should work.
>>>
>>>So if I tried:
>>>
>>>Select * from items Where item_id IN (Select item_id FROM users where user_id = ?)
>>>
>>>
>>>Thanks for the feedback.-Tony
>>
>


-- 
alex p 

Re: CQL and IN

Posted by Oleksandr Petrov <ol...@gmail.com>.
Hi Tony, you can check out a guide here:
http://clojurecassandra.info/articles/kv.html which explains pretty most of
things you need to know about queries for starters.

It includes CQL code examples, just disregard Clojure ones, there's nothing
strictly Clojure-driver specific in that guide.


On Fri, Jul 5, 2013 at 12:18 AM, Rui Vieira <ru...@googlemail.com>wrote:

> You can use the actual item_ids however,
>
> Select * from items Where item_id IN (1, 2, 3, ..., n)
>
>
> On 4 July 2013 23:16, Rui Vieira <ru...@googlemail.com> wrote:
>
>> CQL does not support sub-queries.
>>
>>
>> On 4 July 2013 22:53, Tony Anecito <ad...@yahoo.com> wrote:
>>
>>> Hi All,
>>>
>>> I am using the DataStax driver and got prepared to work. When I tried to
>>> use the "IN" keyword with a SQL it did not work. According to DataStax IN
>>> should work.
>>>
>>> So if I tried:
>>>
>>> Select * from items Where item_id IN (Select item_id FROM users where
>>> user_id = ?)
>>>
>>>
>>> Thanks for the feedback.
>>> -Tony
>>>
>>
>>
>


-- 
alex p

Re: CQL and IN

Posted by Rui Vieira <ru...@googlemail.com>.
You can use the actual item_ids however,

Select * from items Where item_id IN (1, 2, 3, ..., n)


On 4 July 2013 23:16, Rui Vieira <ru...@googlemail.com> wrote:

> CQL does not support sub-queries.
>
>
> On 4 July 2013 22:53, Tony Anecito <ad...@yahoo.com> wrote:
>
>> Hi All,
>>
>> I am using the DataStax driver and got prepared to work. When I tried to
>> use the "IN" keyword with a SQL it did not work. According to DataStax IN
>> should work.
>>
>> So if I tried:
>>
>> Select * from items Where item_id IN (Select item_id FROM users where
>> user_id = ?)
>>
>>
>> Thanks for the feedback.
>> -Tony
>>
>
>

Re: CQL and IN

Posted by Rui Vieira <ru...@googlemail.com>.
CQL does not support sub-queries.


On 4 July 2013 22:53, Tony Anecito <ad...@yahoo.com> wrote:

> Hi All,
>
> I am using the DataStax driver and got prepared to work. When I tried to
> use the "IN" keyword with a SQL it did not work. According to DataStax IN
> should work.
>
> So if I tried:
>
> Select * from items Where item_id IN (Select item_id FROM users where
> user_id = ?)
>
>
> Thanks for the feedback.
> -Tony
>