Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在测试一个查询并希望用来SELECT获取一些初始数据,如下所示:
SELECT
SELECT 1,2,3 UNION SELECT 2,3,4
是否有将这两个选择合并为一个的语法,还是我必须UNION为每一行使用一个语句?
UNION
您可以使用值子句
select t.* from (values(1,2,3), (2,3,4)) as t(col1,col2,col3)
如果要将结果显示为一个结果集,则必须使用 union/union all