>>Previous>>
LIKE
Like is used with character and date data
SELECT column_name
FROM table_name
WHERE column_name [NOT] Like 'string'
1. %- String of zero or more characters
2. _ -Single Character
3. []- Single character within specified range
4. [^]- Single character not within specified range
Wildcard characters when used with Like keyword are enclosed in a single quotation mark
Example
SELECT title_id, title
FROM titles
WHERE title LIKE '%computers%'
OR
SELECT lname
FROM employee
WHERE lname like 'a%'
OR
SELECT lname
FROM employee
WHERE lname like '%a%'
OR
SELECT lname
FROM employee
WHERE lname like '%a'
OR
SELECT title_id, title
FROM titles
WHERE title LIKE '[cdefi]%'
Unknown Values
Null is equivalent to value "unknown"
IS NULL and IS NOT NULL operators are used
SELECT column_list
FROM table_list
WHERE column_name IS [NOT] NULL
Example
SELECT title_id, title
FROM titles
WHERE title_id IS NOT NULL
OR
SELECT title_id, title
FROM titles
WHERE title_id IS NULL
1 comments:
Good Blog thanks for sharing this informative article.
Oracle Fusion HCM Online Training
Oracle Fusion SCM Online Training
Oracle Fusion Financials Online Training
Big Data and Hadoop Training In Hyderabad
Post a Comment