mysql - invalid : aggregate function or the GROUP BY clause -


hey guys can't seem figure out i'm doing wrong here. i'm quite new sql can't wrap head around this. great!

select pc.name [productcategoryname]    ,      min(pch.standardcost) minstandardcost ,      avg(pch.standardcost) averagestandardcost ,      max(pch.standardcost) maxstandardcost     productcategory pc inner join    product p on (pc.productcategoryid = p.productcategoryid) inner join    productcosthistory pch on ( p.productid = pch.productid) pc.name '%bike%' 

you forgot group clause:

select pc.name [productcategoryname]    ,      min(pch.standardcost) minstandardcost ,      avg(pch.standardcost) averagestandardcost ,      max(pch.standardcost) maxstandardcost     productcategory pc inner join    product p on (pc.productcategoryid = p.productcategoryid) inner join    productcosthistory pch on ( p.productid = pch.productid) pc.name '%bike%' group pc.name 

Comments

Popular posts from this blog

matlab - "Contour not rendered for non-finite ZData" -

delphi - Indy UDP Read Contents of Adata -

javascript - Any ideas when Firefox is likely to implement lengthAdjust and textLength? -