码迷,mamicode.com
首页 > 数据库 > 详细

sql contains 用法

时间:2016-06-19 17:04:32      阅读:956      评论:0      收藏:0      [点我收藏+]

标签:

select * from tb where charindex(‘abcdefgh‘,name)>0
select * from tb where patindex(‘%abcdefgh%‘,name)>0

select * from tblTest where ‘abcdefgh‘ like ‘%‘+name+‘%‘
Select * from tblTest where name like ‘%abcdefgh%‘
select * from tblTest where replace(‘abcdefgh‘,name,‘‘) < 8


declare @str varchar(100)
set @str=‘abcdefgh‘
select * from tblTest where @str like ‘%‘+name+‘%‘
--> or
select * from tblTest where replace(@str,name,‘‘)<>@str


select name from tab where replace(name,‘abcd‘,‘‘)<>name 通杀...

 

记录一下,经常用到。

sql contains 用法

标签:

原文地址:http://www.cnblogs.com/zhyp/p/5598224.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!