Postgre SQL: Conditional join between tables and leave the nearest date only I am pulling this query os user 'USv3s_tggf19' in a PostgreSQL database server.