Union query: union and union all; intersect and minus
--Joint query: union and union all; intersect and minus select 1,2 from dual union select 1,2 from dual; --union performs a union operation on multiple result sets, excluding duplicate rows, while sorting by default rules: --1,2 select 1,2 from dual union all select 1,2 from dual; --union all performs a union operation on multiple result sets, including duplicate rows, without sorting: --1,2 --1,2 select 1,2 from dual intersect select 1,3 from dual; --intersect: Perform the intersection operation on the two result sets, excluding duplicate rows, and sort by default rules: -- The query result is empty select 1,2 from dual intersect select 1,2 from dual; --intersect: Perform the intersection operation on the two result sets, excluding duplicate rows, and sort by default rules: --1,2 select 1,2 from dual minus select 1,2 from dual; --minus: Perform a difference operation on the two result sets, excluding duplicate rows, and perform sorting by default rules: -- The query result is empty select 1,2 from dual minus select 1,3 from dual; --minus: Perform a difference operation on the two result sets, excluding duplicate rows, and perform sorting by default rules: --1,2 --You can specify the Order by clause in the last result set to change the sorting method