小锐啦咔咔(提问者)SELECT * FROM dbo.[OEM$] where 制造商 like \'%${制造商}%\' and DESCRIPTION like \'%${DESCRIPTION}%\' and NSN like \'%${NSN码}%\' and PART_NO like \'%${PART_NO}%\' and 1=1 ${if(len(NSN) == 0,\" and ( NSN = \'\' or NSN is null )\",\" and NSN = \'\" + NSN + \"\'\")}
这样不对啊??
郁金香 回复 小锐啦咔咔(提问者)不对。按你的说法,你这样的情况应该这么写:
SELECT * FROM dbo.[OEM$] where 1=1
${if(len(NSM)==0,\'AND 制造商 like \\\'%${制造商}%\\\' AND ( NSN = \\\'\\\' or NSN is null )\\ \'}
${IF(其他情况),\'其他sql条件\',\'其他表达式\'}
小锐啦咔咔(提问者)SELECT * FROM dbo.[OEM$] where 制造商 like \'%${制造商}%\' and DESCRIPTION like \'%${DESCRIPTION}%\' and NSN like \'%${NSN码}%\' and PART_NO like \'%${PART_NO}%\'
怎么加啊?加了不对啊