我从 mysql 开始,我不知道如何解决这样的问题:
SELECT
table1.col1 AS A,
table1.col3 As B
UNION
table2.col2 AS C,
table2.col5 AS D
WHERE
table1.col4 = table2.col6
/*expected*/
A B C D
为什么不直接说:
SELECT
table1.col1 AS A,
table1.col3 As B,
table2.col2 AS C,
table2.col5 AS D
FROM TABLE1
INNER JOIN Table2 on TABLE2.col6=TABLE1.col4
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句