开发者

MySQL SELECT Statment to return 2 columns into 1

I have a table with the following columns

 id, teamA_id, teamB_id

Will it be possible to do a MYSQL SELECT statement that gives both teamA_id and teamB_id in the same column?

EDIT

Consider th开发者_运维技巧is example

From

 id, teamA_id, teamB_id
 1, 21, 45
 2, 34, 67

I need

Teams
21
45
34
67


SELECT teamA_id as 'Teams'
FROM Teams

UNION

SELECT teamB_id as 'Teams'
FROM Teams
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜