使用动态SQL吧,写一个函数就可以了.
主要写法可以参照!
select name from B where name='num_1' into aa;
execute immediate 'select' ||aa|| 'from A' into bb;