Restricting result rows
To specify how you want the rows in a result table to be restricted, specify a SELECT statement with a WHERE clause.
In this example, you will use the SQL Editor to create the following query:
SELECT *
FROM STAFF
WHERE (STAFF.DEPT > 30)
 
1. Create a new SELECT statement and select the STAFF table from the Tables/views list.
2. Select the SELECT * check box.
 
Tip
When you use SELECT *, an asterisk is the only thing other than DISTINCT that can be in the SEColumns, Computed columns, and Column sequence lists are disabled. Turn off SELECT * to re-enable them.
 
Using the WHERE Details window  
Now you are ready to specify the restrictions of the result table rows using a WHERE clause.
1. Select WHERE from the Clause menu.
This displays the WHERE Details window, which looks like the following. Use this window to specify how you want to restrict the rows of the result table.
WHERE Details window
2. Select STAFF.DEPT in the Left operand list. The column becomes the entry in the Left operand text field, and the Operator text field and list are enabled.
3. Select > in the Operator list. The operator becomes the entry in the Operator text field, and the Right operand text field and list are enabled.
4. Type 30 in the Right operand text field. In this sample statement, the staff records that are returned as rows in the result table are restricted to those with department numbers greater than 30.
5. Select Apply to save the WHERE clause and return to the SELECT Details window. If you want, you can name and save your query.
 
Tip
Aside from some of the choices on the Unary operator menu and in the Operator list, the SQL Editor's WHERE Details, HAVING Details, Computed Column Details, and Expression Details windows are identical, so when you learn one, you know them all.
Last modified date: 05/20/2020