mysql union 字段顺序 必须一致
union字段顺序必须一致,否则后面的字段名会失效,都会以第一个顺序为准
SELECT 1 AS a , 11 AS b UNION SELECT 2 AS b, 22 AS a
a | b |
---|---|
1 | 11 |
2 | 22 |
最后更新于 2021-08-31 02:15:45 并被添加「」标签,已有 697 位童鞋阅读过。
union字段顺序必须一致,否则后面的字段名会失效,都会以第一个顺序为准
SELECT 1 AS a , 11 AS b UNION SELECT 2 AS b, 22 AS a
a | b |
---|---|
1 | 11 |
2 | 22 |
最后更新于 2021-08-31 02:15:45 并被添加「」标签,已有 697 位童鞋阅读过。
此处评论已关闭