我一次运行几个SQL语句,给我几个结果集。有没有办法命名结果集,所以我知道它们是什么?
答案 0 :(得分:2)
一种方法是添加名称为
的列SELECT 'ResultSet1' AS name,
1 AS c
FROM (SELECT 1 UNION SELECT 2) AS sub(c)
SELECT 'ResultSet2' AS name,
2 AS d;
SELECT 'ResultSet3' AS name,
3 AS e;
<强> Rextester Demo 强>