March 25th, 2010

SELECT Statement

Posted by admin in C. SELECT Statement

Download Video: MP4


Relational databases have their data stored and retrieved in two-dimensional tables. The SQL command to retrieve data is the SELECT statement. This statement will specify the columns to be returned and may specify the rows to be included. The columns and rows may come from one or more tables or views. The result of the SELECT statement is in the form of a table and is called the “Result Table.” Go on and we will cover the details.

 SELECT   [ALL | DISTINCT]
          [* | column1[, column2, ...]]
   FROM   [table1 correlation, ...
         | view1 correlation, ...]
 {WHERE    condition1[, condition2, ...]}
 {GROUP BY column1[, column2, ...]}
{HAVING    condition1[, condition2, ...]}
 {ORDER BY column1 [ASC | DESC][, column2 [ASC | DESC], ...]};

UPPER CASE characters Must be entered as shown
lower case characters   User specified variable
( )                             Parentheses must be entered where shown
|                               Denotes OR condition
[ ]                             Enclose required parameters, choose only 1
{ }                            Enclose optional parameters
Underline                   Default parameter

Note: || (double vertical bar) is a concatenation symbol and is entered into the statement as shown.

Comments are closed.

Sorry, the comment form is closed at this time.