一个条件为数组的查询语句 select * from 表 where charindex(',000003000001000001,',','+code+',')>0 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 select * from tablewhere charindex('000003000001000001',code ) > 0 create table tt (id int, code varchar(50))insert tt select 16,'000003000001000001'insert tt select 17,'000003000001000001,000003000002'insert tt select 18,'000003000001000001,000003000002,000004000001'insert tt select 19,'000003000002,000004000001'declare @tmp varchar(50)set @tmp='000003000001000001' select * from tt where charindex(code,@tmp)>=0id code16 300000100000117 000003000001000001,00000300000218 000003000001000001,000003000002,000004000001 如果就查询只有'3000001000001'数据declare @tmp varchar(50)set @tmp='000003000001000001' select * from tt where charindex(code,@tmp)>0 查询 数据 问题 关于数据库表名列、名规则问题! 【BCP过滤导出数据表】请帮忙解答,谢谢! 在安装jeecms的时候报这个 Unknown table engine 'INNODB'是怎么回事呢?O(∩_∩)O谢谢 SQL 性能问题 sql server !求围观! sql统计查询 对应关系表,并条件检索 100分求人修改SQL存储过程 编制了一个存储过程,但是有两处错误,不知道是哪里错了! 有兴趣的都来看看! 日期难题 游标应用请教
from table
where charindex('000003000001000001',code ) > 0
create table tt (id int, code varchar(50))insert tt select 16,'000003000001000001'
insert tt select 17,'000003000001000001,000003000002'
insert tt select 18,'000003000001000001,000003000002,000004000001'
insert tt select 19,'000003000002,000004000001'declare @tmp varchar(50)
set @tmp='000003000001000001'
select * from tt where charindex(code,@tmp)>=0
id code
16 3000001000001
17 000003000001000001,000003000002
18 000003000001000001,000003000002,000004000001
declare @tmp varchar(50)
set @tmp='000003000001000001'
select * from tt where charindex(code,@tmp)>0