Friday, 18 December 2015

Which operator is used in query for pattern matching?

LIKE operator is used for pattern matching, and it can be used as -.
 % – Matches zero or more characters.
 _(Underscore) – Matching exactly one character.
Example -.
 MySQL
Select * from Student where studentname like ‘a%’
1
Select * from Student where studentname like ‘a%’
 Select * from Student where studentname like ‘ami_’
 1
Select * from Student where studentname like ‘ami_’

2 comments: