with temp as(
select account_id, asm_signatures_classification, count(*)
from asm_insights
where date = '2020-05-20'
group by account_id, asm_signatures_classification
order by account_id
)
with temp2 as(
select account_id, app_id
from asm_insights
where date = '2020-05-20'
)
select * from temp join temp2 on temp.account_id = temp2.account_id`enter code here`
i wan to have smaller tables for doing some practices, how can i join 2 temp tables like that? what i did getting an error: SQL Error [500310] [42601]: Amazon Invalid operation: syntax error at or near "with" Position: 195;