> > you can use a DO - block: > > > > > > https://www.postgresql.org/docs/current/static/sql-do.html > > > > But DO blocks returns "void", I mean you can't return values/records > from this statement. Insert the necessary records into a temporary table, process them, post-process them into variables or destination table?
pgsql-general by date:
Соглашаюсь с условиями обработки персональных данных