select barcode,xinghao,yanse,downstarttime from dbo.V_showbxdate where downstarttime between '2015-05-31 20:30:00.000' and '2015-06-02 17:10:00.000' and Barcode like 'b%' and (xinghao='BCD-205TF1' or xinghao='BCD-206TBF1') order by downstarttime
模糊OR查詢的時候須要加上小括號,若是不加上就會有問題。sql
(xinghao='BCD-205TF1' or xinghao='BCD-206TBF1')