急急急!在线等!关于ORACLE查询的问题。

2025-02-23 00:46:27
推荐回答(3个)
回答1:

declare q varchar2(1);
s varchar2(400);
begin
select table_name into q
from a
where sno = --此处写你要查询的表的sno

s := 'select * from '||q;
execute immediate s;
end;

回答2:

这个简单的sql肯定实现不了。

用 第三方开发语言,比如c#、java、php 等取出表a 的内容,然后拼成 select * from b 等等;

或者用 存储过程, 同样:取出表a 的内容,然后拼成 select * from b 等等;

回答3:

什么意思?是select * from (select table_name from a where sno= ??) b ;