Skip to main content

UNION

in Anatomy of a DPQL query
Authors list
Опубликованный: 23 мар. 2018 г.|Last updated: 3 нояб. 2022 г.

The UNION keyword is used to combine the result-set of two or more SELECT statements. For example:

SELECT tickets.id FROM ( (SELECT tickets.id FROM tickets WHERE tickets.id > 0 AND tickets.id < 5) UNION DISTINCT (SELECT tickets.id FROM tickets WHERE tickets.id > 5 AND tickets.id < 10) ) AS 'tickets'
copy

UNION needs to be embedded inside FROM (technically making it a sub-query).

ПолезноUnhelpful
next pageGeneral Expression Format
previous pageIN

Please log in or register to submit a comment.