PDF Archive

Easily share your PDF documents with your contacts, on the Web and Social Networks.

Send a file File manager PDF Toolbox Search Help Contact



Les02 .pdf



Original filename: Les02.pdf
Title: PowerPoint Presentation
Author: Oracle

This PDF 1.5 document has been generated by Microsoft® PowerPoint® 2013, and has been sent on pdf-archive.com on 05/11/2015 at 22:55, from IP address 41.176.x.x. The current document download page has been viewed 342 times.
File size: 407 KB (27 pages).
Privacy: public file




Download original PDF file









Document preview


Restricting and Sorting Data

Copyright © 2004, Oracle. All rights reserved.

Objectives

After completing this lesson, you should be able to do
the following:
• Limit the rows that are retrieved by a query
• Sort the rows that are retrieved by a query
• Use ampersand substitution in iSQL*Plus to
restrict and sort output at run time

2-2

Copyright © 2004, Oracle. All rights reserved.

Limiting Rows Using a Selection

EMPLOYEES


“retrieve all
employees in
department 90”

2-3

Copyright © 2004, Oracle. All rights reserved.

Limiting the Rows That Are Selected


Restrict the rows that are returned by using the
WHERE clause:

SELECT *|{[DISTINCT] column|expression [alias],...}
FROM
table
[WHERE condition(s)];



2-4

The WHERE clause follows the FROM clause.

Copyright © 2004, Oracle. All rights reserved.

Using the WHERE Clause

SELECT employee_id, last_name, job_id, department_id
FROM
employees
WHERE department_id = 90 ;

2-5

Copyright © 2004, Oracle. All rights reserved.

Character Strings and Dates





Character strings and date values are enclosed by
single quotation marks.
Character values are case-sensitive, and date
values are format-sensitive.
The default date format is DD-MON-RR.

SELECT last_name, job_id, department_id
FROM
employees
WHERE last_name = 'Whalen' ;

2-6

Copyright © 2004, Oracle. All rights reserved.

Comparison Conditions

Operator
=

Equal to

>

Greater than

>=

2-7

Meaning

Greater than or equal to

<

Less than

<=

Less than or equal to

<>

Not equal to

BETWEEN
...AND...

Between two values
(inclusive)

IN(set)

Match any of a list of values

LIKE

Match a character pattern

IS NULL

Is a null value

Copyright © 2004, Oracle. All rights reserved.

Using Comparison Conditions

SELECT last_name, salary
FROM
employees
WHERE salary <= 3000 ;

2-8

Copyright © 2004, Oracle. All rights reserved.

Using the BETWEEN Condition

Use the BETWEEN condition to display rows based on a
range of values:
SELECT last_name, salary
FROM
employees
WHERE salary BETWEEN 2500 AND 3500 ;
Lower limit

2-9

Upper limit

Copyright © 2004, Oracle. All rights reserved.


Related documents


PDF Document les02
PDF Document les01
PDF Document daffodil day terms and conditions
PDF Document intro
PDF Document powers brawl
PDF Document new pass4itsure 830 506 dumps pdf


Related keywords