Using the SQL Operators : Introduction « Query Select « Oracle PL/SQL Tutorial






The SQL operators allow you to limit rows based on

  1. pattern matching of strings,
  2. lists of values,
  3. ranges of values, and
  4. null values.

The SQL operators are listed in the following table:

OperatorDescription
LIKEMatches patterns in strings
INMatches lists of values
BETWEENMatches a range of values
IS NULLMatches null values
IS NANNew for Oracle10g. Matches the NaN special value, which means "not a number"
IS INFINITENew for Oracle10g. Matches infinite BINARY_FLOAT and BINARY_DOUBLE values


You can also use the NOT operator to reverse the meaning of LIKE, IN, BETWEEN, and IS NULL:

  1. NOT LIKE
  2. NOT IN
  3. NOT BETWEEN
  4. IS NOT NULL
  5. IS NOT NAN
  6. IS NOT INFINITE
SQL>
SQL> SELECT COUNT(*) num_owned, a.owner
  2      FROM dba_objects a
  3      WHERE 10<(SELECT COUNT(*) FROM dba_objects b
  4      WHERE a.owner=b.owner)
  5      GROUP BY a.owner;

 NUM_OWNED OWNER
---------- ------------------------------
       473 MDSYS
      1143 FLOWS_020100
      2769 PUBLIC
       575 JAVA2S
       339 CTXSYS
        34 HR
        12 FLOWS_FILES
       449 SYSTEM
        46 DBSNMP
       668 XDB
      6631 SYS

11 rows selected.








2.1.Introduction
2.1.1.Using the SQL Operators
2.1.2.Subquery with comparison operator
2.1.3.A SELECT with Just a FROM Clause