Using a WHERE Clause

You can use a WHERE clause to select only the data that meets certain criteria and join two tables from the same data source.

To use a WHERE clause, type the column and the condition in the WHERE clause text entry box.

For example, if you have a table (Sales1) containing sales data, you can choose to only output data where the value in the Price column is greater than $10.00. In this case, specify:


Alternatively, if you are extracting data from two tables in the data source, you can use a WHERE clause to relate a column in one table to a column in the another table.

For example, Table1 contains the columns Pcode, OrderNo, and SaleDate and Table2 contains Pcode, CustNo, Quantity, and Cost. You can use the WHERE clause to join the two tables together by the related column. In this case, the column is Pcode and you specify:

Table1.Pcode = Table2.Pcode
Note: Only one column definition called Pcode is loaded or inserted into the grid on the Columns tab.

You can also use a job parameter in the WHERE clause.

The SQL SELECT statement is automatically updated to include the WHERE clause. Click the View SQL tab to display the statement.