现在我需要拼一个SQL,比如获得子查询的第二列数据,前提是子查询返回的数据类型是一样的,select 第二列数据 from (子查询结果)问题是不知道列名,因为子查询的SQL语句是自动生成的:比如生成的是如下两个语句
select name, class from stu
select name, dept from emp我现在只能知道这样分开写:
select class from (select name, class from stu)
select dept from (select name, dept from emp)有没有办法兼容使外面固定而不管子查询字段名呢,  select COL2 from (***)