27,579
社区成员
发帖
与我相关
我的任务
分享
select id,水果名称,case when charindex('苹果',水果名称)>0 then '有' else '无' end from tb
select * from tb where patindex('苹果' , 水果名称 ) > 0
create proc test
@ref varchar(20),
@ret varchar(2) output
as
if exists(select 1 from A where charindex(@ref,水果名称)>0)
set @ret='有'
else
set @ret='无'
return @ret
GO
select * from tb where 水果名称 like '%苹果%'
select * from tb where charindex('苹果' , 水果名称 ) > 0
charindex('苹果',水果名称)>0 --有
select * from tb where 水果名称 like '%苹果%'