关于通配符的问题 myfield like 'test'我想让test的前面是,或空后面也是只能是,或空这个通配符应该怎么写,自己试了下like '[\,NULL]test[\,NULL]'都不对 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 set nocount ondeclare @t table(col varchar(10))insert @t select 'test'insert @t select ',test'insert @t select 'test,'insert @t select ',test,'insert @t select 'aatest'insert @t select 'testaa'insert @t select 'aaatestaa'select *from @t where charindex(',test,',','+col+',') > 0/*col ---------- test,testtest,,test,*/set nocount off --这样?declare @t table(name varchar(50))insert into @t select ',test,asdf'insert into @t select ',test asdf'insert into @t select ',test3,asdf'insert into @t select ' test,asdf'insert into @t select 'stest,asdf'insert into @t select ',stest,asdf'select * from @t where patindex('%[, ]'+'test'+'[, ]%',name)>0 楼主是要NULL ,不是空格 严格应该是 '' 而非NULL 哪有字符里面包含字符,又包含NULL的?说的空格是指' '吧 如果记录中有,,testtest,,,,,test,,,,,,之类的话,前后辍加','再charindex也会取错。 关于报表的问题 100分能够分配给多少人呢? sp_password太可怕了,没有原密码都可以修改sa的登录密码呀。 急待解决,在线等,急决给30分。 求一sql写法 天盾加密软件(SkyShield)我使用“高强度加密”时,出现错误。求高手解决 怎样改数据库的名称? 关于order by排序另类用法 各位高手救命啊!!!!!!!!怎样将SQLserver2000中的数据导入mysql中呢??急!!!!!! 新手提问,在线等谢谢 搞个sql测试,第一个答对者给分。 如果不使用 SQL Mail,如何在 SQL Server 中发送电子邮件
declare @t table(col varchar(10))
insert @t select 'test'
insert @t select ',test'
insert @t select 'test,'
insert @t select ',test,'
insert @t select 'aatest'
insert @t select 'testaa'
insert @t select 'aaatestaa'select *
from @t
where charindex(',test,',','+col+',') > 0/*
col
----------
test
,test
test,
,test,*/set nocount off
--这样?
declare @t table(name varchar(50))
insert into @t select ',test,asdf'
insert into @t select ',test asdf'
insert into @t select ',test3,asdf'
insert into @t select ' test,asdf'
insert into @t select 'stest,asdf'
insert into @t select ',stest,asdf'select * from @t
where patindex('%[, ]'+'test'+'[, ]%',name)>0
哪有字符里面包含字符,又包含NULL的?
说的空格是指' '吧
,,test
test,,
,,,test,,,,,,
之类的话,前后辍加','再charindex也会取错。