pcplans.com § Help and Support Using SQL: SELECT Statement  

Using SQL: SELECT Statement

Article ID:3341
Last Review:Thursday, January 08, 2009
Revision:3.0

INTRODUCTION

The SELECT statement

symptomsIMPORTANT

The SELECT statement


IMPORTANT

Using SQL: SELECT Statement
The SELECT statement is used to query the database and retrieve selected data that match the criteria that you specify.
The SELECT statement will select all of the values in the name, age, and salary columns from the employee table whose age is greater than 50.
back to the top

Using SQL: SELECT Statement


The SELECT statement has five main clauses to choose from, although,
FROM is the only required clause. Each of the clauses have a vast selection
of options, parameters, etc. The clauses will be listed below, but each of
them will be covered in more detail later in the tutorial.



Here is the format of the SELECT statement:


SELECT [ALL | DISTINCT] column1[,column2]
FROM table1[,table2]
[WHERE "conditions"]
[GROUP BY "column-list"]
[HAVING "conditions]
[ORDER BY "column-list" [ASC | DESC] ]



Example:


SELECT name, age, salary
FROM employee
WHERE age > 50;



The SELECT statement will select all of the values in the name, age,
and salary columns from the employee table whose age is greater than 50.




  • NOTE: The SELECT statement
  • back to the top




    Last Reviewed:1/8/2009
    Keywords: kbUsing kbhowtoUsing kbHOWTOUsing #3341 kbAudITProUsing



        Contact

       ©1999-2008 Support at pcplans.com