gpt4 book ai didi

php - 如何将mysql中的两列合并为一列?

转载 作者:行者123 更新时间:2023-11-30 22:11:45 25 4
gpt4 key购买 nike

+-----+---------------+---------------+
| id | team_A | team_B |
+-----+---------------+---------------+
| 1 | Barcelona | Real Madrid |
+-----+---------------+---------------+
| 2 | Milan | Inter |
+-----+---------------+---------------+

select * from table and combine as team_c

结果应该是一列..

team_c as

barcelona
milam
real
inter

team_c 中的所有行都应该不同..因为我需要在自动完成下拉列表中显示两个?

最佳答案

试试这个查询:

select a.team_a as team_c from table a Union select b.team_b from table b

关于php - 如何将mysql中的两列合并为一列?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39909664/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com