CASSANDRA CQL3: set value for whole column
As you will know, CQL! = SQL. It is not possible to accomplish what you are asking in CQL except to iterate over every row in the table.
Robert's suggestion for an override column1
for a static column might help. But static columns are bound to their section key, so you would still need to specify that:
aploetz@cqlsh:stackoverflow2> UPDATE t SET s='XXX' WHERE k='k';
Also, it looks like you only want to set the column value for all rows. A static column won't work for you if you want the column value to be different for the CQL strings in the section (from an example in the DataStax docs):
aploetz@cqlsh:stackoverflow2> INSERT INTO t (k, s, i) VALUES ('k', 'I''m shared', 0);
aploetz@cqlsh:stackoverflow2> INSERT INTO t (k, s, i) VALUES ('k', 'I''m still shared', 1);
aploetz@cqlsh:stackoverflow2> SELECT * FROM t;
k | i | s
---+---+------------------
k | 0 | I'm still shared
k | 1 | I'm still shared
(2 rows)
Note that the column value is the s
same for all CQL rows under the section key k
. You just understand how it works.
source to share