select 1 id,
12 a,
13 b
from dual
union all
select 2,
8,
-2
from dual
运行结果
| id | a | b |
| 1 | 12 | 13 |
| 2 | 8 | -2 |
小结:
union all之类的sql运算,最终结果集的列别名由union all首个数据源集的列别名确定
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/9240380/viewspace-682047/ ,如需转载,请注明出处,否则将追究法律责任。