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 in PL/pgSQL. Thanks for your advidce.