skip to Main Content

Calculate duration between Phase – Postgresql

I have the following history table (record user action): ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | parent_id | property_names | changed_property | time_c | outcome | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | 123456 | {PhaseId,LastUpdateTime} | {"PhaseId":{"newValue":"Fulfill","oldValue":"Approve"},"LastUpdateTime":{"newValue":1671027321749,"oldValue":1671027321170}} | 1671027321749 | success | | 123456 | {PhaseId,LastUpdateTime,ApprovalStatus} | {"PhaseId":{"newValue":"Approve","oldValue":"Log"},"LastUpdateTime":{"newValue":1671011168777,"oldValue":1671011168043},"ApprovalStatus":{"newValue":"InProgress"}} |…

VIEW QUESTION

PostgreSQL interval returned in days

I have this basic PostgreSQL query: SELECT AGE('2021-01-21', '1942-11-20'); Which returns an interval in days: output: 28531 days, 0:00:00 I am using PostgreSQL version 14, according to the docs, AGE() should return a symbolic result in years, months and days…

VIEW QUESTION
Back To Top
Search