This is an old revision of this page, as edited by Ed Poor(talk | contribs) at 13:23, 19 May 2004(cut and paste from SQL article). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.Revision as of 13:23, 19 May 2004 by Ed Poor(talk | contribs)(cut and paste from SQL article)
A SELECT statement in SQL returns a result set of records from one of more tables.
Examples
Table 'T'
Query
Result
C1
C2
1
a
2
b
Select * from T
C1
C2
1
a
2
b
C1
C2
1
a
2
b
Select C1 from T
C1
1
2
C1
C2
1
a
2
b
Select * from T where C1=1
C1
C2
1
a
Given a table T, the querySelect * from T will result in all the elements of all the rows of the table being shown.
With the same table, the query Select C1 from T will result in the elements from the column C1 of all the rows of the table being shown.
With the same table, the query Select * from T where C1=1 will result in all the elements of all the rows where the value of column C1 is '1' being shown.