pl/pgsql, selecting condition from other table : 1st table col: t_id, c_id, town
2st table col: p_id, year_of_birth, t_id -< is ref to t_id in 1st table

    SELECT year_of_birth from 2st where
(
(t_id from 2st) = t_id from 1st) AND (c_id from 1st) = 'text value'
)
;
