我有两个不同的列值:
列1:
johg
michael
pesho
列2:
sth
other
cofee
我想将这两个列联合起来:
johg
michael
pesho
sth
other
cofee
答案 0 :(得分:1)
如果你想在两列中有两个连接值,请在MySQL中尝试CONCAT
。
SELECT CONCAT(`column1`,',',`column2`)
FROM
table_name
或者您正在尝试UNION
SELECT `column1` AS unique_col
FROM
table_name
UNION ALL
SELECT `column2` AS unique_col
FROM
table_name
希望这有帮助。