SELECT statement
To specify the example 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
do the following:
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 pull-down menu, select WHERE.
8. On the WHERE Details window, do the following:
a. In the Left operand field, select EMPLOYEE.NUMBER from the list.
b. In the Operator field, select = from the list.
c. In the Right operand field, select WAGES.EMPNUMBER from the list.
d. Select Add to operand lists.
e. In the Left operand field, select EMPLOYEE.STATE from the list.
f. In the Operator field, select = from the list.
g. In the Right operand field, type NC.
h. From the Unary operator pull-down menu, select Right operand > String constant 'x'.
i. Select Add to operand lists.
j. In the Left operand field., select (EMPLOYEE.NUMBER = WAGES.EMPNUMBER) from the list.
k. In the Operator field, select AND from the list.
l. In the Right operand field, select (EMPLOYEE.STATE = 'NC') from the list.
m. Select Apply.
9. From the Clause pull-down menu, select ORDER BY.
10. On 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: 01/29/2015