比如一个字段是文本型,现在需要查找包含 “abcdefg”这样字串的记录。sql语句怎么写?
------解决方案--------------------
select * from tb where 字段 like '%abcdefg%'
select * from tb where charindex('abcdefg' , 字段) > 0
select * from tb where cast(字段 as varchar) like '%abcdefg%'
select * from tb where charindex('abcdefg' , cast(字段 as varchar)) > 0