请教一下如在在SQL语句里做判断语句?
$sql1 = "select CODE,max(YR_SC),SUM_N,SUM_U from bse_prc_p where CDE_L='".substr($code,0,11)."' and SC_L='YN' and SUM_N is not null and SUM_U is not null ";
我想做个查询,比如 当CODE=‘%TW%’时,执行 SC_L=‘YW’,这个条件查询
当CODE=‘%HK%’时,执行 SC_L=‘YN’,这个条件查询
当CODE=‘其他’时,执行 SC_L=‘CN’or 'BH',这个条件查询
这个怎么做?