Skip to main content
Pentaho Documentation

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.
Note: SQL Query Designer does not work with Hadoop Hive data sources.

You can design an SQL sub-query for your data source with SQL Query Designer:

  1. Click on the connection name and click the Add button to add a query in the Available Queries panel.
  2. Click the Edit button so the SQL Query Designer window appears. This allows you to easily create a SQL query.
  3. Click on the first command in the SQL query you want to use. The query appears in the right panel.
  4. Right-click on the query and select Deselect All so that each field is deselected. Choose the selections with which you want to work.
  5. Right click on the query and select add where condition or add having condition. The condition.edit window appears.
  6. Click on the arrow next to the working query so that the whole path is expanded. Type in the condition and click OK.
  7. Click Preview to ensure the query is working. Click OK to exit the condition.edit window.
  8. 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.