当前位置: 代码迷 >> 高性能数据库开发 >> sql语句的有关问题,主要是后面的条件
  详细解决方案

sql语句的有关问题,主要是后面的条件

热度:9229   发布时间:2013-02-26 00:00:00.0
sql语句的问题,主要是后面的条件
select Supplyid,SupplyState, SupplyPrice,SupplierMark from PurchasePrice where 
Operators='LT' and Province='SD'and Par='100' and SupplyState!=-1 and Code ='0531'or code='' order by SupplyPrice asc




帮忙看一下sql语句那地方错了!!我要实现符合前面条件的数据 ,code字段为某个值或位空!!

怎么写到底!!
请教各位大侠!!!

------解决方案--------------------------------------------------------
select Supplyid,SupplyState, SupplyPrice,SupplierMark from PurchasePrice where 
Operators='LT' and Province='SD'and Par='100' and SupplyState!=-1 and ( Code ='0531'or code='' )order by SupplyPrice asc 
需要加个括号就对了

  相关解决方案