select sum(Qty) AS QUANTITY
from purchase
where ItemName='$iname',
sum(quantity) AS QUANTITY1
from dispatch
where ItemName='$iname';
如果我单独运行此查询,如果我在查询上运行语法错误
,则会得到结果1064 - 来自dispatch where的'sum(Qty)AS QUANTITY1旁边的语法错误 ItemName ='$ iname''Ãla ligne 1
答案 0 :(得分:0)
作为专栏:
select
(select sum(Qty) AS QUANTITY from purchase where ItemName='$iname') AS QUANTITY,
(select sum(quantity) AS QUANTITY1 from dispatch where ItemName='$iname') AS QUANTITY1