select Products.prodname,
sum( billdetail.Qty) as qty,
BillDetail.rate,
sum(billdetail.amt) as Amt
from billdetail
inner join products on products.prodid = billdetail.prodid
inner join category on category.catid = products.catid
group by prodname, rate
where CatName = "Chicken";
答案 0 :(得分:1)
-- Group by Come After Where Clause
select Products.prodname, sum( billdetail.Qty) as qty,BillDetail.rate,
sum(billdetail.amt) as Amt from billdetail
inner join products
on products.prodid = billdetail.prodid
inner join category
on category.catid = products.catid
where CatName = 'Chicken'
group by prodname,rate