_含有下划线的:通常表示用来限制模糊查询的字符个数,除开要查询的字符一个下划线就是匹配一个字符两个下划线就是两个字符n个字符就是匹配到n个字符
select name from tb_category where name LIKE "_学"
select name from tb_category where name LIKE "学_"
select name from tb_category where name LIKE "_学_"
select name from tb_category where name LIKE "_学__"
含有%号的表示匹配0个或多个字符
select name from tb_category where name LIKE "%学"
select name from tb_category where name LIKE "学%"
select name from tb_category where name LIKE "%学%"
含有[]号的表示匹配括号中任意一个的字符(这种似乎在mysql8以后不怎么管用了)
select all username from tab_info1 where username LIKE ' [张李]三'
含有^号的表示匹配中除去匹配的任意一个的字符(这种似乎在mysql8以后不怎么管用了)
select username from tab_info1 where username LIKE'飞[^0-2]';