Quick Search:
 
 The Oracle SELECT Statement      [Return To Index] Jump to:  

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 |    Search |    Code Library |    Sponsors |    Privacy |    Terms of Use |    Contact Us © 2003 - 2024 psoug.org