请问:exec的结果可不可以直接作临时表和其他select语句join?
产生这个问题的原因:
表1有一个字段存储一个sql(select)语句,假设数据如下
col1 col2
abc select Username from T_user where title='经理'
def select Username from T_user where title='副经理'
假设
select Username from T_user where title='经理'出来结果是
张三
李四
select Username from T_user where title='副经理'出来结果是
王二
赵六
那么我需要得到这样一个记录集
newcol1 newcol2
abc 张三
abc 李四
def 王二
def 赵六
临时表的办法恐怕不行,因为表1的每一行的col2的sql语句都可能不一样
各位看看能不能有什么办法实现?分数可以再加!谢谢大家