Difference between revisions of "SELECT Reference"
|(4 intermediate revisions by 4 users not shown)|
Revision as of 11:11, 13 April 2013
The SELECT command is used to show data from a database.
The output from a SELECT statement is always a grid - with a number of rows and a number of columns.
The simplest SELECT commands involve a single table:
SELECT name, population FROM bbc WHERE region='North America'
- The SELECT line determines which columns to show - in this case
population, both of which are columns of the bbc table.
- The WHERE clause determines which rows to show
SELECT statements may nested - that is the output from one SELECT may be the input to another SELECT.
The output from a SELECT may be added to another table using INSERT .. SELECT