SELECT UNION Syntax
Common Syntax
SELECT ...UNION [ALL | DISTINCT] SELECT ...[UNION [ALL | DISTINCT] SELECT ...]
Example
select userid from user union select orderid from ordertbl order by userid; select userid from user union (select orderid from ordertbl group by orderid) order by userid;
Syntax Restrictions
SELECT statements in UNION do not support multiple columns with the same name.
Last Article: SELECT JOIN Syntax
Next Article: SELECT Subquery Syntax
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.