I want a string to be given as input to the SQL \"IN\" clause,where in i want a list of strings separated by commas
As pointed out by the other answers, there are many helpers you can use to do the joining.
I'd like to add a caveat:
Be aware that most DBMS have a upper limit on the number of values that you can concatenate like this. We have run into this before; if you are not certain that you will never have more than a few dozen values or so, you must make sure you do not exceed this limit (which is different for every DBMS, sometimes even configurable).
The limit usually comes either from a limit on the total size of an SQL statement, or an explicit limit on the number of values in a comma-separated list.
If you run into this problem, an alternative is to create a temporary (or permanent) table for the values list, and INSERT
your values into this table. Then you can use a WHERE xxx IN (SELECT column FROM helpertable)
instead of putting the list into the SQL statement. This avoids the maximum length problem; it is also probably faster if you need to re-use the list. It' more hassle (and probably slower) if you only need the list once though...