I have a table like this in a PostgreSQL database:
name, salary, birthdate, last_update
1, Ann Alden, 123000.00, 1986-03-04, 2022-01-04 11:30:30.0
3, Chloe Cat, 99999999.99, 1999-01-15, 2022-01-04 12:25:45.0
4, Don Denton, 91234.24, 2004-08-03, 2022-01-04 12:45:00.0
5, Eddy Edwards, 55125125.25, 2003-05-17, 2022-01-05 23:00:00.0
How would I return all fields of a pair of people where the last_update
field is less than an hour apart?
I would expect the output of:
id, name, salary, birthdate, last_update, id, name, salary, birthdate, last_update
1, Ann Alden, 123000.00, 1986-03-04, 2022-01-04 11:30:30.0, 3, Chloe Cat, 99999999.99, 1999-01-15, 2022-01-04 12:25:45.0
3, Chloe Cat, 99999999.99, 1999-01-15, 2022-01-04 12:25:45.0, 4, Don Denton, 91234.24, 2004-08-03, 2022-01-04 12:45:00.0"