Cheap VPS & Xen Server


Residential Proxy Network - Hourly & Monthly Packages

Oracle SELECT


The Oracle SELECT statement is used to retrieve data from one or more than one tables, object tables, views, object views etc.

Syntax

  1. SELECT expressions
  2. FROM tables
  3. WHERE conditions;

Parameters

1) expressions: It specifies the columns or calculations that you want to retrieve.

2) tables:This parameter specifies the tables that you want to retrieve records from. There must be at least one table within the FROM clause.

3) conditions: It specifies the conditions that must be followed for selection.

Select Example: select all fields

Let’s take an example to select all fields from an already created table named customers

  1. SELECT *
  2. FROM customers;

output

select-output1

Select Example: select specific fields

Example

  1. SELECT age, address, salary
  2. FROM customers
  3. WHERE  age < 25
  4. AND salary > ‘20000’
  5. ORDER BY age ASC, salary DESC

select-output2

Select Example: select fields from multiple tables (JOIN)

  1. SELECT customers.name, courses.trainer
  2. FROM courses
  3. INNER JOIN customers
  4. ON courses.course_id = course_id
  5. ORDER BY name;

output

select-output3

Comments

comments