--SQL 不支持数组,这样做
declare @a varchar(10)
set @a='1,2,3'select * from 表
where charindex(','+cast(id varchar)+',',','+@a+',')>0
declare @a varchar(10)
set @a='1,2,3'select * from 表
where charindex(','+cast(id varchar)+',',','+@a+',')>0
解决方案 »
- 根据条件替换两表中部分相同数据!
- 存储过程输出参数的顺序如何指定?
- 数据库更新问题!
- 关于insert into #tmp exec sp1 parm1,parm2执行速度很慢的问题
- 关于数据库的安装问题!请大家帮我解决一下!
- 为什么在删除表中字段的时候出现这样的提示 对象 df_shouquan_L1003_0A9D95DB 依赖于列 L1003
- SQL2008总是到一半断开连接
- 高手请进-------求一个按数量复制记录的SQL语句
- 在SQL Server中有没有像在Access中使用的DistinctRow的功能(在线等待)
- 怎么用VB访问Access数据库?
- 看看下面这个语句会有什么问题?
- 存储过程里面传递 单引号 怎么办?
select * from 表
where charindex(','+cast(id as varchar)+',',','+@a+',')>0
然后直接使用:
sql="select * from t_news where ID in("&字符串&")"