JOIN emailsendings es ON et. ID = es.emailtemplate_id
ORDER BY es.sentonat desc
pgsql-performance by date:
Соглашаюсь с условиями обработки персональных данных