1 回答
繁星coding
TA贡献1797条经验 获得超4个赞
mysql> create table alpha(alpha char(20));
Query OK, 0 rows affected (0.20 sec)
mysql> insert into alpha values('alpha'),('alpha(1)'),('alpha(2)'),('alpha( 1)'),('alpha(3c)');
Query OK, 5 rows affected (0.02 sec)
Records: 5 Duplicates: 0 Warnings: 0
mysql> select * from alpha;
+-----------+
| alpha |
+-----------+
| alpha |
| alpha(1) |
| alpha(2) |
| alpha( 1) |
| alpha(3c) |
+-----------+
5 rows in set (0.00 sec)
mysql> select * from alpha where alpha regexp '^alpha(\\([0-9]+\\))?$';
+----------+
| alpha |
+----------+
| alpha |
| alpha(1) |
| alpha(2) |
+----------+
3 rows in set (0.00 sec)
添加回答
举报
0/150
提交
取消