oracle 怎么把第一个表的查询结果作为第二个表的被查询字段

发布网友

我来回答

3个回答

热心网友

execute immediate ‘select ' || (select 字段 from 表1 where rownum=1) || ' from 表2'

热心网友

select table1.column1, table1.column2 ... from
(select column1, column2 ...) table 1
where table1.column1 = ...

这么套起来不就好了么?追问table1里面只有一个字段,里面存了很多条,我要把他们选出来作为第二个表的被查询字段,要怎么做呢?

热心网友

select * from table1 where table1.a in (select table1.a from table2).

声明声明:本网页内容为用户发布,旨在传播知识,不代表本网认同其观点,若有侵权等问题请及时与本网联系,我们将在第一时间删除处理。E-MAIL:11247931@qq.com