一条sql语句 string abc="aa,bb,cc,";如何查询出id 在abc中的记录。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 我也是刚学会的select * from table where instr(','||abc||',',','||id||',')>0; 谢谢楼上的,我运行了一下,报错了。语句里有abc 这样不对吧 select * from table where 字段 in ('",abc,"') 你是在哪里运行的,我写的那个abc指的是你那个串 我这样写的:select * from T_table where instr(','||aa,bb,||',',','||ID||',')>0 select * from table where 字段 in ('",abc,"')这个也试了,不对 晕,这样啊那这样就行了select * from T_table where id in('aa','bb'); 我的abc里面的字符是不一定的。没法写成你的那样 那样的化就把你的串存入变量abc,然后按我1楼那个执行 加入我的串就是aa,bb,cc,应该怎么写呢? 写成这样select * from T_table where instr(','||aa,bb,cc,||',',','||ID||',')>0 ???? string abc="aa,bb,cc,";上面那个不是把串已经放到abc里了吗,然后直接执行下面的,不要修改select * from table where instr(','||abc||',',','||id||',')>0; select * from tablewhere instr(id,'aa,bb,cc')>0 Oracle RAC Install on Windows 2008 求一个SQL语句 一个Oracle数据文件的问题 REP-1401,ORA-01403错误 oracle 导入数据出错 数据库的远程操作 第一次遇到这么怪的问题.... 将A表中数据按照一定条件检索后的结果全部插入到B表中 oracle字符集问题 asp连接oracel 9i问题求助 解决后加分 hibernate 配置OARCLE ID自增问题 。请大家帮助! 【求助】这样的sql要怎么写(查询结果作条件,再次查询,返回两次查询的结果)
select * from table where instr(','||abc||',',','||id||',')>0;
语句里有abc 这样不对吧
select * from T_table where instr(','||aa,bb,||',',','||ID||',')>0
那这样就行了
select * from T_table where id in('aa','bb');
上面那个不是把串已经放到abc里了吗,然后直接执行下面的,不要修改
select * from table where instr(','||abc||',',','||id||',')>0;
where instr(id,'aa,bb,cc')>0