Re: In query not working
This feels a bit dodgy to me. I'm guessing the csv variable is actually being passed in and isn't a constant. I'm also guessing your foreignKeyId field is an integer which means you a comparing text with an integer which is not good practice. All that said the following should work:
DECLARE csv VARCHAR(255);
SET csv = '268,484,435';
SELECT *
FROM tableX
WHERE FIND_IN_SET(foreignKeyId, csv) != 0;
Subject
Written By
Posted
Re: In query not working
July 30, 2009 06:55AM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.