SELECT statement 1
Suppose you have the following SQL SELECT statement:
SELECT EMPLOYEE.JOBCODE, WAGES.GROSSPAY, EMPLOYEE.NAME
FROM EMPLOYEE, WAGES
WHERE (EMPLOYEE.NUMBER = WAGES.EMPNUMBER) AND (EMPLOYEE.STATE = 'NC')
ORDER BY EMPLOYEE.JOBCODE ASC, WAGES.GROSSPAY DESC
To specify the statement:  
1. In the Query name field, type a name for the SELECT statement.
2. In the Description field, type a description for the SELECT statement.
3. In the Tables/views list, select EMPLOYEE and WAGES.
4. In the Columns list, select EMPLOYEE.JOBCODE, EMPLOYEE.NAME, and WAGES.GROSSPAY.
5. In the Column sequence list, select EMPLOYEE.NAME.
6. From the Column sequence pop-up menu, select Move after > WAGES.GROSSPAY.
7. From the Clause menu, select WHERE.
Next, in the displayed WHERE Details window:  
1. In the Left operand field, select EMPLOYEE.NUMBER.
2. In the Operator field, select =.
3. In the Right operand field, select WAGES.EMPNUMBER.
4. Select Add to operand lists.
5. In the Left operand field, select EMPLOYEE.STATE.
6. In the Operator field, select =.
7. In the Right operand field, type
a. NC
8. From the Unary operator menu, select Right operand Submenu indicatorString constant 'x'.
9. Select Add to operand lists.
10. In the Left operand field, select (EMPLOYEE.NUMBER = WAGES.EMPNUMBER).
11. In the Operator field, select AND.
12. In the Right operand field, select (EMPLOYEE.STATE = 'NC').
13. Select Apply.
Finally, complete the statement:  
1. From the Clause menu, select ORDER BY.
2. In the ORDER BY Details window, do the following:
a. In the Columns list, select EMPLOYEE.JOBCODE and WAGES.GROSSPAY.
b. In the ORDER BY sequence list, select WAGES.GROSSPAY.
c. From the ORDER BY sequence pop-up menu, select Descending (DESC).
d. Select Apply.
Last modified date: 03/28/2020