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;
这个简单的sql肯定实现不了。
用 第三方开发语言,比如c#、java、php 等取出表a 的内容,然后拼成 select * from b 等等;
或者用 存储过程, 同样:取出表a 的内容,然后拼成 select * from b 等等;
什么意思?是select * from (select table_name from a where sno= ??) b ;