sql - How do I list the names and addresses for those employees whose addresses has at least 3 digits? -


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; 

i'm guessing

select fname, lname, address  employee  address  address regexp '^[0-9]{3}[ ]'; 

except returns addresses 3 digits

use {m,}. matches @ least m occurrences of preceding subexpression

select fname, lname, address  employee  address  address regexp '^[0-9]{3,}[ ]'; 

Comments

Popular posts from this blog

java - Run spring boot application error: Cannot instantiate interface org.springframework.context.ApplicationListener -

reactjs - React router and this.props.children - how to pass state to this.props.children -

Excel VBA "Microsoft Windows Common Controls 6.0 (SP6)" Location Changes -