Вот пример для ваших таблиц:
SELECT split_part(id, '.', 1) AS id1,
split_part(id, '.', 2) AS id2,
split_part(id, '.', 3) AS id3,
price_8, price_10
FROM crosstab(
'select id1||''.''||id2||''.''||id3 as id, cast(tax_rate as text) as taxRate, price
from (select * from Table1 natural left join Table2
order by 1,2,3) t'
)
AS ct (
id text,
price_8 int,
price_10 int
);