我从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
答案 0 :(得分:1)
为什么不说:
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