Database Reference
In-Depth Information
DELETE
specified after the
DELETE
keyword, only those columns will be removed. If no
columns are specified, the entire row will be removed. Just as with the
INSERT
and
UPDATE
statements, the
PRIMARY KEY
must be specified.
Listing 4.13
Example Usage of
DELETE
DELETE event_data
FROM events
WHERE event_time=1365977131666
AND url='http://www.google.com';
BATCH
in one request. All statements that have the same partition key will be applied
atomically.
Listing 4.14
Example Usage of
BATCH
BEGIN BATCH
UPDATE events USING TTL 345600
SET event_id=now(),
network_location='10.10.10.10',
event_data='{"browser": "Firefox"}'
WHERE event_time=1365977131666
AND url='http://www.google.com';
DELETE event_data
FROM events
WHERE event_time=1365977131666
AND url='http://www.google.com';
APPLY BATCH;