Database Reference
In-Depth Information
DELETE
The DELETE statement ( Listing 4.13 ) removes columns and rows. If columns are
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
Click here to view code image
DELETE event_data
FROM events
WHERE event_time=1365977131666
AND url='http://www.google.com';
BATCH
The BATCH statement ( Listing 4.14 ) allows a user to specify multiple statements
in one request. All statements that have the same partition key will be applied
atomically.
Listing 4.14 Example Usage of BATCH
Click here to view code image
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;
 
 
Search WWH ::




Custom Search