存储过程,单引号有关问题

存储过程,单引号问题

请教个问题,存储过程中参数,,IN stype VARCHAR(50)

我需要这样使用 where a in(stype) 它默认是 where a in (‘1,2,3’) 

,我现在想要 where a in (1,2,3) 。。。。各位请问这样要怎么处理啊




把要执行的sql拼成一个字符串,再prepare执行。




set @asql=concat(‘select … from … where a in(\”,type,’\’)’);

prepare stml from @asql;

execute stml;




where find_in_set(a,’1,2,3′)




where find_in_set(a,stype)

存储过程,单引号有关问题

相关文章:

你感兴趣的文章:

标签云: