日期:2014-05-16  浏览次数:21201 次

此语句何处有误?
SQL code
SQL query: 

?SELECT C . * , L.number, N.weight, N.vol, N.qty, O.qty / O.pcs AS RATE, O.weight / O.qty AS ONEW, O.vol / O.qty AS ONEV FROM pick_cart_location C LEFT JOIN location L ON C.saleId = L.id LEFT JOIN inventory_now N ON L.number = N.number LEFT JOIN inventory_origin O ON L.number = O.number WHERE L.status =  '0' AND C.status =  '0' AND C.saleId =  '6'

MySQL said: 

#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SELECT C.*,L.number,N.weight,N.vol,N.qty,O.qty/O.pcs AS RATE,O.weight/O.qty A' at line 1 


在cmd终端可以通过,在PHP中,报错。

------解决方案--------------------
SELECT C.* L.number, N.weight, N.vol, N.qty, O.qty / O.pcs AS RATE, O.weight / O.qty AS ONEW, O.vol / O.qty AS ONEV FROM pick_cart_location C 
LEFT JOIN location L ON C.saleId = L.id 
LEFT JOIN inventory_now N ON L.number = N.number 
LEFT JOIN inventory_origin O ON L.number = O.number 
WHERE L.status = '0' AND C.status = '0' AND C.saleId = '6'

在MYSQL下没有问题,检查一下PHP代码
------解决方案--------------------
SELECT 


这是什么意思 怎么select之前有什么符号吗