Oracle Quick Tips #1
LIKE & REGEXP_LIKE
LIKE:-
The Oracle LIKE condition allows wildcards to be used in the WHERE clause of a SELECT,INSERT,UPDATE or DELETE statement.
REGEXP_LIKE:-
The Oracle REGEXP_LIKE condition allows you to perform regular expression matching in the WHERE clause of a SELECT, INSERT, UPDATE, or DELETE statement.
From the above statements we can conclude that there is no much difference in the functionality of a LIKE and REGEXP_LIKE conditions.
But when we use these operators to find/match multiple values/words the repetition can be avoided by using REGEXP_LIKE.
LIKE Example:
REGEXP_LIKE Example: Much Easier
- The pipe symbol '|' inside the regular expression acts as the OR operator and the parenthesis () form the subexpression that is needed for that OR.
OR & ANY
OR:-
The Oracle OR operator is a logical operator that combines Boolean expressions and returns true if one of the expressions is true.
ANY:-
The Oracle ANY operator is used to compare a value to a list of values or result set returned by a subquery.
But instead of writing multiple OR operators the ANY operator can be used to avoid repetition.
OR Example:
ANY Example: Much Easier
Happy CODING!!!
THANK YOU:)
Comments
Post a Comment