用sql语句查出来字段里包含某个字符串的所有记录

一般用substring函数截取出特定字段,如

--用户姓名第二个字是'大'字的
select from Users where SUBSTRING(UserName,2,1)='大'
第二种方法就是直接like模糊查询,看具体情况使用
select from Users where UserName like '%大%'
 
 
 
posted @ 2019-09-23 17:54  易水蜗牛  阅读(61133)  评论(0编辑  收藏  举报