Please enable JavaScript to view this site.

R:BASE 11 Help

Navigation: How To (Forms, Reports, and more) > Queries/Views > Query Builder > Technical Documents

Building a Query Using a Union

Scroll Prev Top Next More

A "Union" can be added to your queries in order to combine the results of two or more SELECT statements. This optional operator combines the results of two SELECT commands or clauses, displaying the results of the second SELECT command below those of the first. By default, unions deletes duplicate rows.

 

Include the optional keyword ALL to include duplicate rows in the final result.

 

The UNION operator requires the following three conditions:

 

The SELECT statements must specify an equal number of columns.

Columns that are being combined must have the same data type.

Only the last SELECT statement can contain an ORDER BY clause.