(And I don't think the one inside the lateral join is doing you any good). Try:... a.next_contact is not null limit 1) sq order by sq.next_contact DESC;
(And I don't think the one inside the lateral join is doing you any good). Try:
pgsql-general by date:
Соглашаюсь с условиями обработки персональных данных