I made a select using the WITH query something like this:
WITH test AS (select id, sum(value) as value from test group by id)
SELECT name, t.value from names JOIN test t ON (t.id = names.id)
But I need to use 2 WITH queries, is there any way to make it?