Add a SQL Query

If you need to retrieve the data based on a more complex query than just selecting the field from a single table, you will need this feature. The SQL Query can be as much complicated as the database provider can support. This means that you could join tables, do summarization and grouping without any issues.

To add a SQL query:

  1. From the Tables window, in the upper left hand corner, click on Add and select Add SQL Query.
  2. In the Destination Table Name field, enter a name for the table destination.
  3. In the SQL Expression text box, enter the SQL statement and click on Save.
Important

Using of the schema name in the SQL statement is highly recommended.

Note

The QUERY will be added in the list.

Once in the list, you can:

  • Do a mouse over to see the whole SQL statement,
  • Click on the QUERY hyperlink in the Table Source column to change the statement any time,
  • Apply a filter directly in the query statement (ex: select field1, sum(qty) from schema.table1 group by field1 where field2 = 2018) or in the row of the Filter column as a regular table If you are looking for more clarity.
Tip

You can also get access to the Tables windows by clicking on the hyperlink within the Tables column on the Extraction page.