sql like语句多加一个条件查询

select pitem_id,pitem_name,spec,valid_id,general_id
from ctlm5050
where spec_dec>=300
and pitem_id like'05%'
and valid_id<>'N'
order by pitem_id
;
想在加个查询pitem like '06%'的条件,怎么写?

select pitem_id,pitem_name,spec,valid_id,general_id
from ctlm5050
where spec_dec>=300
and (pitem_id like'05%' or pitem like '06%')
and valid_id<>'N'
order by pitem_id
-----
对同字段的"或"可以用"or"
温馨提示:内容为网友见解,仅供参考
无其他回答
相似回答