sql 小技巧

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')
相关文章
相关标签/搜索