mysql> select * from t2;
+------+------+-------------+------+-------------+
| id | name | address | yy1 | favourater |
+------+------+-------------+------+-------------+
| 11 | 1 | zhongshna1 | 2 | computer |
| 12 | 1 | zhongshna1 | 2 | computer |
| 13 | 1 | zhongshna1 | 2 | computer |
| 14 | 2 | fengzhenshi | 3 | mathematics |
| 15 | 3 | bookkeeper | 3 | mathematics |
| 16 | 3 | bookkeepers | 5 | mathematics |
| 16 | 3 | boekkeepers | 5 | mathematics |
| 17 | 3 | boekkoepers | 5 | mathematics |
+------+------+-------------+------+-------------+
8 rows in set (0.00 sec)
mysql> select address from t2 where address regexp '(o|e){2}.*e{2}';
+-------------+
| address |
+-------------+
| bookkeeper |
| bookkeepers |
| boekkeepers |
+-------------+
3 rows in set (0.00 sec)
为啥结果会出现 boekkeepers?
查询条件 (o|e){2}.*e{2} 中o和e已经被 | 隔开,那么应该出现2个o 或者2个e然后后面接着2个e才对,但是第三个条件并不满足呀?
看下面这句,还是同样的问题。
mysql> select address from t2 where address regexp '(o|e){2}.*ee';
+-------------+
| address |
+-------------+
| bookkeeper |
| bookkeepers |
| boekkeepers |
+-------------+