DB2 graphic  QMF Version 8

Format of SQL queries

Many simple SQL queries use the following basic SQL statement:

SELECT columnname
 FROM tablename
 WHERE condition
 ORDER BY columnname

Figure 62 shows a basic SQL query. This query displays the employee names, years of service, and salaries from the Q.STAFF table.

Figure 62. A basic SQL query
 SQL QUERY                               MODIFIED    LINE 1
 
 SELECT NAME, YEARS, SALARY
   FROM Q.STAFF
   ORDER BY NAME_
 
 
 
 
 
 
 
 
 
 
 *** END ***
 
 
 1=Help       2=Run        3=End      4=Print     5=Chart        6=Draw
 7=Backward   8=Forward    9=Form     10=Insert   11=Delete       12=Report
 OK, cursor positioned.
 COMMAND ===>                                   SCROLL ===> PAGE


Go to the previous page Go to the next page

Downloads | Library | Support | Support Policy | Terms of use | Feedback
Copyright IBM Corporation 1982,2004 Copyright IBM Corporation 1982, 2004
timestamp Last updated: March, 2004