SQL code: ÏÖÓÐÒÔ×Ö·û´®ÈçÏ£º×Ö¶ÎDescription ÖÐÒ»Ìõ¼Ç¼Ϊ'RESISTOR-MELF*MF-1OHM*1%*1.5MMX3.6MM-0204' ÎÒÏë´ÓÖвéÕҹؼü×Ö Declare @Keyword µ±@Keyword='1OHM' ÎÒÓÃÈçÏÂÆ¥ÅäDescription not like '%[*-]'+@Keyword+'[*-]%' µ±@Keyword='RESISTOR-MELF*MF-1OHM*1%*1.5MMX3.6MM-0204' ÎÒÓÃDescription not like '%'+@Keyword+'%' ÎÒÄܲ»Äܽ«ÒÔÉÏÁ½¸ö²éѯÈںϵ½Ò»¸öÓï¾äÖУ¬ÇóÖú¸÷λ´ó´óÃÇ
ÎÒÏÖÔÚÏëµ½µÄÊÇÔÚDescription not like '%[*-]'+@Keyword+'[*-]%'Öн«[*-]ÖмÓÉÏ´ú±í¿ÕµÄ×Ö·û£¬µ«ÊÇÎÒ²»ÖªµÀ¸ÃÔõôд£¬Çó½Ì°¡~
ô¶® À´µãÊý¾Ý¿´¿´
ÄѶȺÃÏñºÜ¸ß
... SQL code:
select * from tbl where (@Keyword='1OHM' and Description not like '%[*-]'+@Keyword+'[*-]%') or (@Keyword='RESISTOR-MELF*MF-1OHM*1%*1.5MMX3.6MM-0204' and Description not like '%'+@Keyword+'%')