Adding and Deleting Tables in a Query
This topic introduces how to add an delete tables in a query.
- To add some extra tables to a query:
- In the Query Editor, select Menu > Query > Add Tables/Views/Queries. The Add Tables/Views/Queries dialog appears.
- 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 select to add them into the Selected Tables/Views/Queries box.
You can mash up multiple data resources from the same catalog data source 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 query 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 select .
- 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 in the resource tree in the left box, which have already been added to the right 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.
- Select 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 unselected to be included.
- Select Menu > Query > Arrange Table/View/Query to organize the tables.
- Select the required columns in each table. To select all, select *. The columns will be displayed in the criteria panel in the lower part of the Query Editor. However for tables in MongoDB connection, you cannot select all columns by selecting *. The PrimaryKey and ForeignKey columns in each table cannot be selected to a query.
- To remove tables from a query:
- In the Query Editor, select the table that you want to delete, then do any of the following:
- Select Delete Table on the toolbar.
- Select Menu > Query > Delete Table/View/Query.
- Select the x button at the top right corner of the table.
- Repeat the above steps to delete other tables. After deleting a table from a query, any joins based on the table will be removed.
- In the Query Editor, select the table that you want to delete, then do any of the following: