如 要判断sxsx这个字段是否包含三星 要怎么写sql语句
select a.*, c.value('.','varchar(50)') as list from 表 a
cross apply(select cast('<row>'+replace(sxsx,',','</row><row>')+'</row>' as xml) as xmlcode) C1
cross apply xmlcode.nodes('*') t(c)
where c.value('.','varchar(50)') like '三星'
cross apply(select cast('<row>'+replace(sxsx,',','</row><row>')+'</row>' as xml) as xmlcode) C1
cross apply xmlcode.nodes('*') t(c)
where c.value('.','varchar(50)') like '三星'
温馨提示:答案为网友推荐,仅供参考
第1个回答 2017-10-23
SQL SERVER
select * from 表 where CHARINDEX(sxsx,'三星')>0
oracle
select * from 表 where instr(sxsx, '三星') > 0本回答被网友采纳
select * from 表 where CHARINDEX(sxsx,'三星')>0
oracle
select * from 表 where instr(sxsx, '三星') > 0本回答被网友采纳