select * from 表 where ciyt like '%substring(''1301'',1,2)%'
解决方案 »
- 求助sql语句解决自增关键字重排/初始化问题,下面这些语句在哪写啊?
- SQL 2005里怎么把GUID换算成bigint
- 急用,跪求各位大虾!!!
- SQL的执行过程
- 关联查询
- 请教一个关于向ntext字段写入整篇英文文章的问题
- 服务器为什么别人做的ASP程序无法连接到SQL2005,我自己的ASP.NET 可以的啊,他的程序本地测试都是好的
- sqlserver导出txt文件的问题:Cannot use the output option when passing a constant to a stored procedure
- 多表查詢
- 求sql查询语句
- 请问怎么将程序中的变量xb传到数据库中,在线等
- 安装时的问题:在SQL Server 2000快安装完了时发生!!怎么没人能帮我么,好急哦!!
select *
into city
from
(
select '1100,1200,1301' city
union
select '1100,1200,1300'
union
select '1101,1200,1301'
union
select '1200,1301'
)
info--查询
declare @s_parm varchar(20)
declare @s_sql varchar(200)
set @s_parm = '1201'
select *
from city
where patindex('%,' + @s_parm + ',%',','+ city + ',') > 0 or
patindex('%,' + left(@s_parm,2) + '%',','+ city + ',') > 0 --删除测试数据
drop table city
select *
into city
from
(
select '1100,1200,1301' city
union
select '1100,1200,1300'
union
select '1101,1200,1301'
union
select '1200,1301'
)
info--查询
declare @s_parm varchar(20)
declare @s_sql varchar(200)
set @s_parm = ',1201,1101,'select distinct
city
from
city,
(select distinct top 50
colid,
substring(@s_parm,colid + 1,charindex(',',@s_parm,colid + 1) - colid - 1) parm
from syscolumns
where substring(@s_parm,colid,1) = ',' and
charindex(',',@s_parm,colid + 1) <> 0
order by colid
) info
where patindex('%,' + info.parm + ',%',','+ city + ',') > 0 or
patindex('%,' + left(info.parm,2) + '%',','+ city + ',') > 0 --删除测试数据
drop table city
如果针对你的算法,10W条记录判断下来,会要多久?
如果针对你的算法,10W条记录判断下来,会要多久?