DROP TABLE IF EXISTS employee;
CREATE TABLE employee (
Fname varchar(15) NOT NULL,
Minit char(1) default NULL,
Lname varchar(20) NOT NULL,
Ssn varchar(11) NOT NULL,
Bdate date default NULL,
Address varchar(50) default NULL,
Sex char(1) default NULL,
Salary float(10,2) default NULL,
Super_ssn char(9) default NULL,
Dno int(11) NOT NULL,
PRIMARY KEY (Ssn)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
我在猜测
SELECT Fname, Lname, Address
FROM employee
WHERE Address WHERE Address REGEXP '^[0-9]{3}[ ]';
除此之外只返回3位数的地址
答案 0 :(得分:0)
使用{m,}
。这匹配至少m次出现的前一个子表达式
SELECT Fname, Lname, Address
FROM employee
WHERE Address WHERE Address REGEXP '^[0-9]{3,}[ ]';
答案 1 :(得分:0)
使用长度函数
SELECT FNAME, LNAME, ADDRESS
FROM EMPLOYEE
WHERE LENGTH(ADDRESS) >= 3;