Timestamps and TTLs

Timestamps and TTLs

Instructor-svg Al-Mamun Sarkar
Sep 22 , 2020

In this lesson, I will show you how to get insert or update of a column and how to add TTL on update and insert query.

 

Getting writetime of a column:

SELECT city, name, writetime(name) 
FROM employees;

 

Adding TTL (Time To Live) on Update query:

UPDATE employees USING TTL 30 SET name='Bob' WHERE id = 1;

Column will be deleted after given seconds here 30 seconds.

 

Using TTL on Insert Query:

INSERT INTO employees (id, city, name) 
VALUES ( 4, 'Rangpur', 'Jon Doe') 
USING TTL 20;

 

  • Share On:
  • fb
  • twitter
  • pinterest
  • instagram