### Adding and deleting tables in a query

- To add some extra tables to a query:
  1. In the Query Editor window, select Add Table/View/Query from the Query menu to bring up the Add Table/View/Query dialog. See the dialog.

  2. In the All Tables/Views/Queries box, all the tables, views, synonyms, queries, imported SQLs, stored procedures and user defined data sources in the current catalog data source in which the query is added are listed. Select the resources you want to use in the query and click to add them into the Selected Tables/Views/Queries box. You can mash-up multiple data resources in a query if you want. When two resources (for example, a table and a view) use the same name, they cannot be added to the right box at the same time, and when a table is already contained in a query, you cannot add the table and the query at the same time.

     To remove unwanted resources from the Selected Tables/Views/Queries box, select them and click .

  3. If the current catalog data source contains JDBC connections, the Include Added Tables/Views option is available. Check it if you want to show the tables, views and synonyms that have already been added to the query in the All Tables/Views/Queries box. You can then add the tables, views and synonyms of the JDBC connections to the query as many times as you want by providing different names for the tables, views and synonyms each time you add them in the Input Table Name dialog.
  4. Click OK to add the selected resources to the current query. When a query, imported SQL, stored procedure or user defined data source is added, it will be added as a single table with all of its columns.
  5. Click Arrange Table/View/Query on the Query menu to organize the tables.
  6. Select the required columns in each table. To select all, click *. The columns will be displayed in the criteria panel of the Query Editor.

     For tables in query of a MongoDB connection, you cannot select all columns by clicking *. The PrimaryKey and ForeignKey columns in each table cannot be selected to a query.

- To remove tables from a query:
  1. Select the table that you want to delete in the Query Editor window.
  2. Click Delete Table/View/Query on the Query menu.
  3. Repeat the above steps to delete other tables.

Notes:

- For tables added to a query, you can decide whether or not show the full name of the fields (with table names) by checking the option Show Mapping Names on the Query menu.
- After deleting a table from a query, any joins based on the table will be moved.
- In the criteria panel, if you do not want to show the table names for the selected columns, you can uncheck Show Table Names on the Query menu.

- To delete a column in a table, select the column in the criteria panel and click Delete Column on the Column menu. You can also undo the deletion by finding the field in the table and placing a check mark beside it.