Multiple inserts:
with tmp_a as (
select name from tmp_test3
)
from tmp_a
insert overwrite table tmp_test1
select name where name = 'test123'
insert overwrite table tmp_test2
select name where name = 'test123'
with tmp_a as (
select name from tmp_test3
)
from tmp_a
insert overwrite table tmp_test1
select name where name = 'test123'
insert overwrite table tmp_test2
select name where name = 'test123'