create table card(
password varchar(20) not null
)
2.批量插入数据值
insert into card(password)
select 'ab' union
select 'abc' union
select 'abcd' union
select 'bc' union
select 'bcd' union
select 'cab'
3.查看数据
/*查看数据*/
select * from card
4.通配符查询
/*只能查询一个字符*/
/*ab*/
select * from card where password like 'a_'
/*任意长度字符串*/
/*ab,abc,abcd*/
select * from card where password like 'a%'
/*ab,abc,abcd,cab*/
select * from card where password like '%a%'
/*[]需要包括括号里的字符*/
/*ab*/
select * from card where password like 'a[b]'
/*ab,abc,abcd*/
select * from card where password like 'a[b]%'
/*[^]不能包括括号里的字符*/
/*null*/
select * from card where password like '[^a]'
/*bc,bcd,cab*/
select * from card where password like '[^a]%'