Hi all i have a problem with a simple query im hoping one of you clever sql junkies can help me
ok i have a product table and am listing product id with product cost like so:
SELECT x.id,x.cost
FROM product x
Now the problem occurs when i want to add another column which lists tha average cost of items. I have tried this:
SELECT x.id,x.cost,AVG(x.cost)
FROM product x
GROUP BY x.id,x.cost;
I have also tried union. But to no avail :( i presume i am using totally the wrong technique? please point me in the right direction! thx muchly