WHERE 1=1${if(len(abc)==0,"","and data_2 like '"+abc+"'")}
abc为参数
我想当abc为空时,列出全部,当abc有值时,模糊匹配
请教高手
WHERE 1=1${if(len(abc)==0,""," and data_2 like '%"+abc+"%'")}
WHERE 1=1${if(len(abc)=0,"","and data_2 like '%"+abc+"%'")}
同@mysean,这个是对的
where 1=1
${if(len(abc)==0,"",and data_2 like '%"+abc+"%'")}