## Creating and modifying a union query

The Union option in the Query menu of the Query Editor enables you to combine specified records from more than one query into a result set.

To create a union query:

1. Right-click on a selected query (here we call it primary query) and select Edit Query.
2. In the Query Editor, select Union from the Query menu, and then click Create.
3. Specify a name for the query in the Input Query Name dialog, and then click OK.
4. A new Query Editor will be opened. Create the query as required in the editor.

Notes:

- When creating a union query, note that the selecting order should refer to the order in the primary query. The SQL type and the number of the selected columns should match those in the primary query. For example, if you select two columns in the primary query, the first one is of Integer type, and the second one is of String type. Then, in the union query, you should also first select an Integer column, and then a String type column.
- A union query cannot support formulas and parameters.

After a union query is set up, you can also modify it at any time.

To modify a union query:

1. Right-click on the primary query and select Edit Query.
2. In the Query Editor, click Query > Union > Select to bring up the Union dialog. See the dialog.

3. To add a union to the query, select a union from the Queries box, and then click . To remove a union from a query, select a union from the Union box, and then click .
4. In the Union box of the dialog, select the Attribute column to specify the type of the union.
   - : No duplicate records will be returned.
   - : All records will be returned.
5. When done, click OK to confirm the changes.