i have id and program_name
like 1 abc
2 xyz
3 pqr
on selection of programs i am storing data in database as ~1~3(if 1 and 3 is selected)
what i want to do now is that i want to write a query where program id not in(1,3)
since when i am retrieving data from database, i am getting data as ~1~3 and after splitting the data i am storing it in array but how can i use that with sql query with not in command
Splitting and storing in string to use in sql command
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.

VulpesRank #55 · 29.2K reputationPosted Nov 14, 2011, 3:43 AM EST
nishant ranjanRank #4,961 · 317 reputationPosted Nov 14, 2011, 8:51 PM EST
i.e
it could be like this ~3~54~23~78~12~
or
~5~7~12
or ~1
and we have to use in runtime not in (3,54,23,78,12)
or not in (5,7,12)
or as data we have in database