mysql第八章用通配符进行过滤

it2024-11-01  8

(1)select user, last_name from users where user like 'ad%'; #匹配ad开头的数据,字数无限制 (2) select user, last_name from users where user like '%or%'; #匹配中间字符是or的数据 (3)select user, last_name from users where user like 's%y'; #匹配s开头y结尾的字符,中间字符无限制 (4)select user, last_name from users where user like '_mithy'; #_通配符只能匹配一个字符,匹配结尾是mithy的数据

最新回复(0)