Introduction to DB2 for z/OS
|
Previous topic |
Next topic |
Contents |
Glossary |
Contact z/OS |
PDF
How a SELECT statement works Introduction to DB2 for z/OS |
|
|
SQL statements, including SELECT, are made up a series of clauses that are defined by SQL as being executed in a logical order. SELECT statements allow users to definite and organize information that is retrieved from a specified table.
In addition:
Example 1: Consider
this SELECT statement,
which is not valid:
SELECT EMPNO, (SALARY + COMM) AS TOTAL_SAL FROM EMP WHERE TOTAL_SAL> 50000; The WHERE clause is not valid because DB2® does not process the AS TOTAL_SAL portion of the statement until after the WHERE clause is processed. Therefore, DB2 does not recognize the name TOTAL_SAL that the AS clause defines. |
Copyright IBM Corporation 1990, 2010 |