LIKE Operator

From rbachwiki
Revision as of 18:19, 24 October 2017 by Bacchas (talk | contribs) (Created page with "The LIKE operator is unique, in that it’s used with wildcard characters to search for patterns. Wildcard characters are used to represent one or more alphanumeric characters...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

The LIKE operator is unique, in that it’s used with wildcard characters to search for patterns. Wildcard characters are used to represent one or more alphanumeric characters. The wildcard characters available for pattern searches in Oracle 11g are the percent sign (%) and the underscore symbol ( _ ). The percent sign represents any number of characters (zero, one, or more), and the underscore symbol represents exactly one character

find any customer whose last name starts with P and don’t care about the remaining letters of the last name

SELECT lastname
FROM customers
WHERE lastname LIKE 'P%'

find missing number

SELECT *
FROM customers
WHERE customer# LIKE '10_9';

Back To Top- Home - Category