Quantcast
Viewing all articles
Browse latest Browse all 3

Mysql query - Event to delete rows by its value

need help here

I want a query to delete all rows in which column value is older than today.One of the columns is 'check_in' (values in timestamp format) and I want the query to identify the row that has values where the timestamp is older than today (midnight oriented ex: 1588809600 ) and delete them.

Try this but select all rows :

DELETE FROM events WHERE timestamp < (NOW() - INTERVAL 1 DAY)

Maybe something like this but it give me sintax erros :

DELETE FROM events WHERE check_in = timestamp < (NOW() - INTERVAL 1 DAY)

Basically, i want to create an event that every day delete rows where check_in value in older than today.

Can you help?


Viewing all articles
Browse latest Browse all 3

Trending Articles