In oracle, like condition is used with select, insert, update, and delete in where clause using wildcard. It allows pattern matching.
expression LIKE pattern [ESCAPE 'escape_character' ]
expression: name of column.
pattern: patter to be matched in expression. Pattern can be in one of the following:-
Wildcard | Explanation |
---|---|
% | Used for matching string |
_ | Used for matching single character |
Query: select * from table1 where name like 's%'
Query: select * from table1 where name like '22___'
Query: select * from table1 where name NOT like 's%'