Use SQL Servers AVG keyword/function
SELECT
o.column1, o.column2, ...
avg(p.price)
FROM
Objecttable o
JOIN Pricetable p on o.id = p.id
WHERE
<put criteria if needed otherwise leave WHERE out>
GROUP BY
o.column1, 0.column2, .... (but not the column in the avg() expr)
hollystyles
Veteran Poster
1,182 posts since Feb 2005
Reputation Points: 262
Solved Threads: 68