SlideServe
Menu
Préférences
© SlideServe · v2026

Restricting and Sorting Data

ertl avatar
13 diapositives · 239 Views · Jan 07, 2020

Learn how to limit and sort data in Oracle SQL through clauses like WHERE and ORDER BY. Understand comparison operators, logical operators, and wildcards to efficiently query your database.

Restricting and Sorting Data - slide 1
01 / 13Restricting and Sorting Data
1 / 17

Télécharger la présentation

Restricting and Sorting Data
Une image / un lien ci-dessous est fourni (tel quel) pour télécharger la présentation

Politique de téléchargement : le contenu du site vous est fourni TEL QUEL pour votre information et votre usage personnel ; il ne peut être vendu, concédé sous licence ni partagé sur d’autres sites sans l’accord de son auteur.Le contenu vous est fourni TEL QUEL, pour votre information et votre usage personnel uniquement. Téléchargez la présentation en cliquant sur ce lien. Lors du téléchargement, si vous ne parvenez pas à télécharger une présentation, l’éditeur a peut-être supprimé le fichier de son serveur.Pendant le téléchargement, si vous ne parvenez pas à obtenir une présentation, le fichier a peut-être été supprimé par l’éditeur.

F I N

Plus de contenu associé

Transcription de la présentation
  1. Restricting and Sorting Data Kroenke, Chapter Two From Introduction to Oracle:SQL and PL/SQL, Oracle

  2. Topics • Limiting rows selected (Where) • Sorting selected rows (Order By) From Introduction to Oracle:SQL and PL/SQL, Oracle

  3. Limiting Rows Selected SELECT [ DISTINCT ] { * | column [alias], … } FROM table [ WHERE condition (s) ]; From Introduction to Oracle:SQL and PL/SQL, Oracle

  4. Where Clause Can Compare • Values in columns • Literal values • Arithmetic expressions, or • Functions From Introduction to Oracle:SQL and PL/SQL, Oracle

  5. Character Strings & Dates • Enclosed in single quotation marks • Character valuescase sensitive • Date values • format sensitive • Default – DD-MON-YY From Introduction to Oracle:SQL and PL/SQL, Oracle

  6. Comparison Operators • = • > • >= • < • <= • <> Syntax -- WHERE expr operator value From Introduction to Oracle:SQL and PL/SQL, Oracle

  7. Examples From Introduction to Oracle:SQL and PL/SQL, Oracle

  8. Other Comparison Operators • BETWEEN … AND …  Between two values (inclusive) • IN(list)  Matches any value in list of values • LIKE  Match a character pattern • IS NULL  Is a null value From Introduction to Oracle:SQL and PL/SQL, Oracle

  9. LIKE Wildcards • %  any sequence of zero or more characters • _ (underscore)  any single character • ESCAPE Option to match wildcard characters From Introduction to Oracle:SQL and PL/SQL, Oracle

  10. Logical Operators • AND True if both conditions True • OR  True if either condition True • NOT  • True if condition False • False if condition True • Null if condition Null From Introduction to Oracle:SQL and PL/SQL, Oracle

  11. Operator Precedence Rules • All comparison operators • NOT • AND • OR Override rules with parenthesis. From Introduction to Oracle:SQL and PL/SQL, Oracle

  12. ORDER BY Clause • Sorts rows • ASC  ascending order (default) • DESC  descending order • Must be last clause in Select statement From Introduction to Oracle:SQL and PL/SQL, Oracle

  13. Order By Syntax SELECT expression FROM table [WHERE condition(s)] [ORDER BY {column, expr}|ASC|DESC||; From Introduction to Oracle:SQL and PL/SQL, Oracle