Wednesday, 18 January 2023

Postgresql - To find the time differences between two columns in a table

SELECT 

A.id, A.ts, TIMEDIFF (B.ts,A.ts) AS timedifference

FROM log A 

INNER JOIN log B ON B.id = (A.id + 1)

ORDER BY TIMEDIFF (B.ts,A.ts) DESC

No comments:

Snowflake - Notes

WPRKSPACES -  In September 2025, Snowflake introduced Workspaces, which combines the functionality of Worksheets, Notebooks, File Manager, Q...