Sample Table Structure:
- Table Name: TableA
- Column Name: column1
- Column Type: Timestamp
SQL Query to find out last 1 hour records:
- SELECT * FROM TableA a WHERE {fn timestampdiff(SQL_TSI_HOUR, a.column1, current_timestamp)} > 1
SQL Query to find out last 1 day records:
- SELECT * FROM TableA a WHERE {fn timestampdiff(SQL_TSI_DAY, a.column1, current_timestamp)} > 1
No comments:
Post a Comment