Regular expression in mysql

by kalai 2009-07-20 12:23:23

If you want to discard field value containing '-' in between the string, you can make use of following regular expression
NOT (exp REGEXP 'pattern')

Example
$sql=" select count(*) as count,substring_index(server,'/',2) as name from sitemap where
server like '%$server%' and NOT (server REGEXP '$server-') group by name order by count desc ";

Tagged in:

1367
like
0
dislike
0
mail
flag

You must LOGIN to add comments