if I need to update certain column with some value and this change needs to be done on multiple rows in that case I can use IN operator with where clause . But I was going through documentation and there is mentioned as below :
" To specify more than one row, use primary_key_name IN ( primary_key_value, primary_key_value … ). This only works for the last component of the primary key."
on above I understand we need to use primary key IN operator , but I am confused with "This only works for the last component of the primary key."
what does above line indicate here ?
[EDIT] Sample schema:
CREATE TABLE killrvideo.poc ( id int, address text, name text, age text, education text, status text, PRIMARY KEY ((id, address), name, age) ) WITH CLUSTERING ORDER BY (name ASC, age ASC);
cqlsh:killrvideo> select * from poc; id | address | name | age | education | status ----+---------+------+-----+-----------+-------- 4 | satna | RM | 23 | BE | Single 1 | satna | AM | 27 | BE | Single 2 | satna | RT | 31 | BE | Single 3 | Pune | AK | 27 | BE | Single
update command :
update poc set status = 'M' where age in ('27','31');
error :
InvalidRequest: Error from server: code=2200 [Invalid query] message="Some partition key parts are missing: id, address"