求一条SQL语句 根据一个订单的ID 号.我要进行模糊查询比如果想查订单号是以 1,3,5这三个数结尾的我在文本框输入1,3,5 在以逗号拆分,然后在进行LIKE 相映模糊查询怎么查?如果只查以1结尾的容易,现在要查三个怎么弄? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 declare @tb table(id varchar(50))insert into @tb select '001'insert into @tb select '002'insert into @tb select '003'insert into @tb select '004'insert into @tb select '005'select * from @tbwhere charindex(','+right(id,1)+',',','+'1,3,5'+',')>0001003005string strid = "1,3,5";string sql="select * from tb where charindex(','+right(id,1)+',',','+"+strid+"+','"; 根本不要拆分,直接查询就可以了:select * from 表名 where RIGHT(Convert(nvarchar(50),ID),1) in (1,3,5) 为什么这句老出错呢?错误:没有权限 关于DropdownList 增加选项内容问题 GridView的行进行编辑,更新,删除 vs2005中的TreeView 一个简单的问题 中国人为何勤劳却不富有? 真正的技术问题。关于asp和asp.net的底层问题 ★★★高手进,此页的状态信息无效,可能已损坏。 ★★★ ListBox使用求解 水晶报表的横向统计问题!! 二进制流上传文件大小问题,请高手指点! 如何用非递归的方法得到页面上的所有控件?
insert into @tb select '001'
insert into @tb select '002'
insert into @tb select '003'
insert into @tb select '004'
insert into @tb select '005'select * from @tb
where charindex(','+right(id,1)+',',','+'1,3,5'+',')>0001
003
005string strid = "1,3,5";
string sql="select * from tb where charindex(','+right(id,1)+',',','+"+strid+"+','";