Create Sub-Queries with SQL Query Designer
You must be in the JDBC Data Source window to follow this process. You must also have a configured and tested JDBC data source connection.
SQL Query Designer does not work with Hadoop Hive data sources.
You can also design an SQL sub-query for your data source with SQL Query Designer by performing the following steps:
- Click on the connection name and click the Add button to add a query in the Available Queries panel.
- Click the Edit button so the SQL Query Designer window appears. This allows you to easily create a SQL query.
- Click on the first command in the SQL query you want to use. The query appears in the right panel.
- Right-click on the query and select Deselect All so that each field is deselected. Choose the selections with which you want to work.
- Right-click on the query and select add where condition or add having condition. The condition.edit window appears.
- Click on the arrow next to the working query so that the whole path is expanded. Type in the condition and click OK.
- Click Preview to ensure the query is working. Click OK to exit the condition.edit window.
- Drag the queries you have created into the workspace, in the Details row. Preview the report to ensure that everything is working as expected.
You now have an SQL sub-query that returns a data set that you can use for reporting.