ORACLE LIKE CONDITION

In oracle, like condition is used with select, insert, update, and delete in where clause using wildcard. It allows pattern matching.

Syntax

expression LIKE pattern [ESCAPE 'escape_character' ]  

Parameters

expression: name of column.

pattern: patter to be matched in expression. Pattern can be in one of the following:-

WildcardExplanation
%Used for matching string
_Used for matching single character

Table 1:

ORACLE LIKE CONDITION

Table 2:

ORACLE LIKE CONDITION

Example 1

Query: select * from table1 where name like ‘s%’

ORACLE LIKE CONDITION

Example 2

Query: select * from table1 where name like ’22___’

ORACLE LIKE CONDITION

Example 3

Query: select * from table1 where name NOT like ‘s%’

ORACLE LIKE CONDITION

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *