Regex or Regular Expression in Sql

by Mohan 2014-07-10 13:06:17

Regex or Regular Expression  in Sql

Sql allows to use regular expressions in query.

You can use a regular expression in the select query  as follows:
 
SELECT lastname, firstname FROM persons WHERE lastname REGEXP '^(a|b|c)';


This select query retrives lastname,firstname with lastname starting with a or b or c.
 

Tagged in:

1242
like
0
dislike
0
mail
flag

You must LOGIN to add comments