您好,我喜欢多列,
Address1, Address2
value1, value2
我在地址中需要这个单列名称,如下所示
Address
value1
value2
如何使用mysql查询执行此操作?
请有人帮助我......
答案 0 :(得分:1)
您可以对这两列中的UNION
进行操作,将它们放入一列中:
SELECT Address1 AS Address
FROM yourTable
UNION ALL
SELECT Address2 AS Address
FROM yourTable
答案 1 :(得分:1)
您可以使用Union
,例如
Select Address1 as Address
FROM Table
UNION
Select Address2
FROM Table