Hi is there any way I can use != operator using CQL in Cassandra? I am trying to use a != operator on my columnfamily but when I try using that it says:
cqlsh:EPCContent> select * from "MediaCategoryGroup" where "MCategoryID"!=1;
I get this error:
Invalid syntax at line 1, char 55
select * from "MediaCategoryGroup" where "MCategoryID"!=1;
^
NOT EQUALS " operator is used to search for content where the value of the specified field does not match the specified value. It cannot be used with text fields; see the DOES NOT CONTAIN (" !~ ") operator instead. Typing `field != value` is the same as typing `NOT field = value`.
CQL does not support wildcard queries. CQL does not support Union, Intersection queries. Table columns cannot be filtered without creating the index. Greater than (>) and less than (<) query is only supported on clustering column.
Use the DISTINCT keyword to return only distinct (different) values of partition keys. The FROM clause specifies the table to query. You may want to precede the table name with the name of the keyspace followed by a period (.). If you do not specify a keyspace, Cassandra queries the current keyspace.
Using the SELECT command with the IN keyword. The IN keyword can define a set of clustering columns to fetch together, supporting a "multi-get" of CQL rows. A single clustering column can be defined if all preceding columns are defined for either equality or group inclusion.
If you look at the Cassandra SELECT syntax, you will see that the WHERE
clause must be "composed of relations on the columns that are part of the PRIMARY KEY and/or have a secondary index defined on them." Does your column conform to that specification?
Just for your information this is the full list of relation operators: '=' | '<' | '>' | '<=' | '>=' | '!=' | IN | CONTAINS | CONTAINS KEY
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With