Quick Search:
CODE
Oracle PL/SQL Code Library
JOBS
Find Or Post Oracle Jobs
FORUM
Oracle Discussion & Chat
 The Oracle SELECT Statement      [Return To Index] Jump to:  
  Looking for the original pages? (formerly called "Morgan's Library") You can find them here.

Term: SELECT

Definition:
The SELECT statement retrieves or extracts information from tables in the database. Using the SELECT statement, you can choose the rows in a table that you want returned from a query by specifying values to match the rows that you want to see (or don't want to see).

Basic Select statement:
In its simplest form a SELECT statement must contain the following:

  • A SELECT clause, which specifies the COLUMNs containing the values to be matched against.
  • A FROM clause, which specifies the TABLE containing the COLUMNs listed in the SELECT clause.

Example SELECT Statement:

SELECT * FROM users 
WHERE name = 'john'


The example above retrieves all rows from the table 'users' where the 'name' column contains the text 'john'.

You can also use the JOIN capability in the SELECT clause to bring together data that is stored in two or more tables. You do this by matching and/or or comparing columns in the tables you are SELECTing from.

A SELECT statement almost always includes the WHERE clause, which applies one or more conditions to match against the column(s) in the table. The WHERE clause allows you to screen or filter for only the rows you want.
Related Code Snippets:
 
Home      :      Code Library      :      Sponsors      :      Privacy      :      Terms of Use      :      Contact Us 212 users online    © 2009 psoug.org
PSOUG LOGIN
Username: 
Password: 
Forgot your password?