Subquery with Like operator : LIKE « Query Select « Oracle PL/SQL Tutorial






SQL>
SQL>
SQL> SELECT COUNT(*) num_owned, a.owner
  2      FROM dba_objects a
  3      WHERE a.owner NOT IN (SELECT b.owner FROM dba_objects b
  4      WHERE b.owner LIKE 'S%')
  5      GROUP BY a.owner;

 NUM_OWNED OWNER
---------- ------------------------------
       473 MDSYS
         3 TSMSYS
      1143 FLOWS_020100
      2769 PUBLIC
         8 OUTLN
       575 JAVA2S
       339 CTXSYS
        34 HR
        12 FLOWS_FILES
        46 DBSNMP
       668 XDB

11 rows selected.

SQL>
SQL>








2.19.LIKE
2.19.1.Using the LIKE Operator
2.19.2.Underscore character (_) matches one character in a specified position.
2.19.3.Percent character (%) matches any number of characters beginning at the specified position.
2.19.4.ESCAPE option
2.19.5.Combine UPPER and LIKE operator
2.19.6.Subquery with Like operator
2.19.7.Use _ and % together
2.19.8.Use three _ together
2.19.9.Use _ to match a phone number
2.19.10.Second letter is A
2.19.11.Using Pattern Matching LIKE '____ %'
2.19.12.ESCAPE from LIKE