Regular expression in mysql
by kalai[ Edit ] 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 ";