SQL 将不关联数据表中的两个字段放入同一字段?
我正在尝试这样做的是 SQL:
-------------------------------
Table A
-------------------------------
ID | Title
1 | Something Groovy
2 | Something Else
-------------------------------
Table B
-------------------------------
ID | Title
1 | Something Different
2 | Something More
很棒的 Select 语句
-------------------------------
Both in one field
-------------------------------
Title
Something Groovy
Something Else
Something Different
Something More
有什么想法吗?
I am trying to do this is SQL:
-------------------------------
Table A
-------------------------------
ID | Title
1 | Something Groovy
2 | Something Else
-------------------------------
Table B
-------------------------------
ID | Title
1 | Something Different
2 | Something More
Awesome Select Statement
-------------------------------
Both in one field
-------------------------------
Title
Something Groovy
Something Else
Something Different
Something More
Any Ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
使用
UNION ALL
获取两个选择的并集。如果您想消除重复项,只需使用UNION
。Use
UNION ALL
to obtain the union of two selects. If you want to eliminate duplicates, use simplyUNION
.这是一个简单的联合:
请注意,任何相同的项目都将被消除。
This is a simple union:
Note that any items that are identical will be eliminated.