January 2005
Beginner to intermediate
928 pages
22h 14m
English
You use the SELECT statement to query tables or views from a database. At a minimum, the statement contains a SELECT clause and a FROM clause. The following are two examples of a SELECT statement. This first example uses the wildcard symbol (*) to indicate that all columns from the employee table are selected:
SELECT * FROM employee;
In this example, the column names are specified in the SELECT statement:
SELECT empno, firstnme, lastname FROM employee;
When data is retrieved from a table using the SELECT clause, you can derive new columns based on other columns. Figure 9.1 illustrates this: the column totalpay is derived by adding the salary and comm columns.
Read now
Unlock full access