And _% difference in SQL and the like and =

staff tables: 


 

 =和like

Difference: = match a precise value, like a match range

select * from staff where name = 'bob';

 


 select * from staff where name like 'bob';

 


_with%

Differences: _ matches any one character,% matches any more characters 

 select * from staff where name like '_lice';

 


select * from staff where name like '%e';

 


 


concat: splicing 

select id,name, concat( name,'是', job) from staff;

 

 

Published 114 original articles · won praise 131 · views 10000 +

Guess you like

Origin blog.csdn.net/weixin_44364444/article/details/105289243