Database Reference
In-Depth Information
Figure 6.1
Select * from webpage.
Figure 6.2
A wide set of results from the log table.
across is slow and could possibly lead to errors in reading the results if we slipped our eyes
to the wrong line while scrolling. It is much better to get exactly the data that we want. The
SELECT command allows you to specify the columns that you want returned as in the fol-
lowing example:
SELECT webpageid,datecreated
FROM
log
You will notice that the above query has the table names separated by commas. If we run
this query we get the results shown in Figure 6.3, which give us just the data that we want.
When you use the SELECT statement to return columns it divides your table vertically,
retrieving only the specific columns that answer your query. You can specify any of your
columns with the SELECT statement, including all of them, but the asterisk means less typ-
ing. You can also select the same column more than one time, as well as selecting columns
from different tables. You may not yet see why you would want to use the latter two meth-
ods, but we will return to them later.
Search WWH ::




Custom Search