Select where in problem
Posted on 2010-01-12
I have a problem with the following query. This one is made of a principal query and a subquery. As designed so far, the subquery returns a list of ID's seperated by a comma (,) so it's results looks like "1,2,3,4,5,6,7" and this part works.
Now I try to include this "string" of results into a select where in statement so it would look like select * from blabla where xxx in (1,2,3,4,5,6,7) but Oracle triggers an error ORA-01722: invalid number, so I guess something must be wrong with the content of the result of my subquery, probably the datatype or my query is faulty by design.
Do you guys know any solution ?
select BG_USER_07 "Subject",
where BG_BUG_ID IN (
SELECT TO_CHAR(REPLACE(LOWER(SUBSTR(CSET_VALUE, INSTR(CSET_VALUE,'LogicalFilter')+24, (INSTR(CSET_VALUE,'VisualFilter')-INSTR(CSET_VALUE,'LogicalFilter')-27))), ' or ', ','))
WHERE CSET_CATEGORY = 'BugViews'
and CSET_NAME = '184.108.40.206'
Thanks for the help !