You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cassandra.apache.org by Dmitry Lazurkin <di...@gmail.com> on 2018/09/09 00:11:51 UTC

NEQ-restriction in select-where clause

Hello.

Does it make sense to implement != restriction in select-where clause?
Is it possible?

Thank you.

PS. I want to implement that.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cassandra.apache.org
For additional commands, e-mail: dev-help@cassandra.apache.org


Re: NEQ-restriction in select-where clause

Posted by dilaz03 <di...@gmail.com>.
Yes, but I need for select ;-)

пн, 10 сент. 2018 г., 11:03 Jacques-Henri Berthemet <
jacques-henri.berthemet@genesys.com>:

> Hi,
>
> You can only use IF = or IF != on insert, update or delete statements, it
> does not work on select. When using it, it will create a LWT transaction
> and you'll need full PK in the where condition, you can apply the IF on
> values of the row. For example:
>
> update table set type = 'somethingelse' where pk='42' if type !=
> 'something';
>
> --
> Jacques-Henri Berthemet
>
> -----Original Message-----
> From: Dmitry Lazurkin <di...@gmail.com>
> Sent: Sunday, September 09, 2018 2:12 AM
> To: dev@cassandra.apache.org
> Subject: NEQ-restriction in select-where clause
>
> Hello.
>
> Does it make sense to implement != restriction in select-where clause?
> Is it possible?
>
> Thank you.
>
> PS. I want to implement that.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@cassandra.apache.org
> For additional commands, e-mail: dev-help@cassandra.apache.org
>
>

RE: NEQ-restriction in select-where clause

Posted by Jacques-Henri Berthemet <ja...@genesys.com>.
Hi,

You can only use IF = or IF != on insert, update or delete statements, it does not work on select. When using it, it will create a LWT transaction and you'll need full PK in the where condition, you can apply the IF on values of the row. For example:

update table set type = 'somethingelse' where pk='42' if type != 'something';

--
Jacques-Henri Berthemet

-----Original Message-----
From: Dmitry Lazurkin <di...@gmail.com> 
Sent: Sunday, September 09, 2018 2:12 AM
To: dev@cassandra.apache.org
Subject: NEQ-restriction in select-where clause

Hello.

Does it make sense to implement != restriction in select-where clause?
Is it possible?

Thank you.

PS. I want to implement that.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cassandra.apache.org
For additional commands, e-mail: dev-help@cassandra.apache.org


Re: NEQ-restriction in select-where clause

Posted by dilaz03 <di...@gmail.com>.
Thank you. Yes, I known, it's working only for ALLOW FILTERING. Ok, I
understand, it's possible.

пн, 10 сент. 2018 г., 11:24 Benjamin Lerer <be...@datastax.com>:

> It can be done for filtering, otherwise it is really tricky (I am not even
> sure it can be done to be honest).
>
>
>
> On Sun, Sep 9, 2018 at 2:11 AM, Dmitry Lazurkin <di...@gmail.com> wrote:
>
> > Hello.
> >
> > Does it make sense to implement != restriction in select-where clause?
> > Is it possible?
> >
> > Thank you.
> >
> > PS. I want to implement that.
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@cassandra.apache.org
> > For additional commands, e-mail: dev-help@cassandra.apache.org
> >
> >
>

Re: NEQ-restriction in select-where clause

Posted by Benjamin Lerer <be...@datastax.com>.
It can be done for filtering, otherwise it is really tricky (I am not even
sure it can be done to be honest).



On Sun, Sep 9, 2018 at 2:11 AM, Dmitry Lazurkin <di...@gmail.com> wrote:

> Hello.
>
> Does it make sense to implement != restriction in select-where clause?
> Is it possible?
>
> Thank you.
>
> PS. I want to implement that.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@cassandra.apache.org
> For additional commands, e-mail: dev-help@cassandra.apache.org
>
>