I am sorry, I know that this is an SQL problem ... . I need reach different rows in 2 almost same tables. I need use it inPL/pgSQL. Thanks for your advidce.
pgsql-novice by date:
Соглашаюсь с условиями обработки персональных данных