桌子:
purchase_stock_entry(id,purchase_party_id,bill_no,dt,product_id,qty,price,type)
purchase_party_name(purchase_party_id,name_shop)
我希望列中的输出(bill_no,name_shop,sum(qty*price))
与这两个表的连接一样
我也在尝试:
select p1.bill_no,p2.name_shop,p1.qty*p1.price as [Total],p1.dt from purchase_stock_entry
p1,purchase_party_name p2 where p1.purchase_party_id=p2.id
但总和我怎么能?