您的位置:首页 > 数据库 > Oracle

oracle ORA-01722无效数字

2012-10-26 14:09 549 查看
我有一个表table_a 里面有一个字段field中保存了用户的编号,编号使用逗号隔开,例如:379,380,386,390,503我做查询select * from user where user_id in (379,380,386,390,503); 是正确的。 但是当我查询 select * from user where user_id in (select field from table_a where id = 1);时却报oracle ORA-01722无效数字

答:select * from user where INSTR( (select ',' || field || ',' from table_a where id = 1), ',' || TRIM(TO_CHAR(user_id )) || ',' ) > 0
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: