Verified Commit 26389b99 authored by Kiryuu Sakuya's avatar Kiryuu Sakuya 🎵
Browse files

Thanks to @enihsyou

parent 45d3115e
......@@ -167,6 +167,12 @@ ALTER TABLE employee ADD CONSTRAINT Check_Sex CHECK (emp_sex IN ("男", "女", "
ALTER TABLE employee ADD CHECK(emp_no RLIKE "[0-9][0-9][0-9][0-9][0-9]");
```
如果用 REGEX 的话就是
```mysql
ALTER TABLE employee ADD CONSTRAINT CHECK (emp_no REGEXP '\\d{5}');
```
或者,输入的编号必须以 E 开头的 5 位数编号
```mysql
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment