如何在另一个中使用一个SQL语句的输出

Dis*_*ame 3 sql oracle oracle11g

我有以下声明:

select region_id from regions
where region_name = 'Europe' 
Run Code Online (Sandbox Code Playgroud)

我在下面的语句中需要输出,其中'bla'是:

select count(*) from countries
where region_id = 'bla'
Run Code Online (Sandbox Code Playgroud)

我怎样才能做到这一点?

mca*_*ral 6

试试IN子句

select distinct * from countries
where region_id IN (select region_id from regions
where region_name = 'Europe')
Run Code Online (Sandbox Code Playgroud)