查询出menupath字段中 出现 “- "(横杆)大于3次的 记录

表明为productclass    我想查询出menupath字段中 出现 “- "(横杆)大于3次的 记录

答:1 
select from productclass  where menupath  REGEXP '[[:digit:]]+-[[:digit:]]+-[[:digit:]]+-'  这样就可以 不过不建议用正则查询出menupath字段中 出现 “- "(横杆)大于3次的 记录

2

select * from productclass   where length(menupath) - length(replace(menupath,'-',''))  >3

posted @ 2014-09-26 22:54  水飝飞天  阅读(223)  评论(0编辑  收藏  举报