有没有办法合并来自不同查询的结果集?例如
Query A
SELECT DISTINCT HighEnd FROM Chipset
HighEnd
------------
Class A
Class B
Class C
和
Query B
SELECT DISTINCT LowEnd FROM VideoCard
LowEnd
------------
Class X
Class Y
Class Z
并使其像这样
CombinedSets
------------
Class A
Class B
Class C
Class X
Class Y
Class Z
答案 0 :(得分:2)
SELECT DISTINCT HighEnd AS CombinedSets FROM Chipset
UNION
SELECT DISTINCT LowEnd AS CombinedSets FROM VideoCard
答案 1 :(得分:1)
Union或Union All
SELECT DISTINCT HighEnd as CombinedSets FROM Chipset
UNION
SELECT DISTINCT LowEnd FROM VideoCard