Hello Arun, > paste("select * from ", tablename , " where colors in (",paste(var1,collapse=","),")") [1] "select * from DressMaterials where colors in ( red,blue,green,white )" Regards!