Reputation: 95
Need help on writing query to select all fields where field_value > average of that fields value. eg:
SELECT * WHERE NumWords > "Average of total numwords" FROM tblAdverts;
I tried this query but had no luck:
SELECT *
FROM tblAdverts
WHERE NumWords >(SUM(NumWords/COUNT(AdID)));
Upvotes: 0
Views: 54
Reputation: 103
Try this:
SELECT * FROM tblAdverts WHERE NumWords >(SELECT AVG(NumWords) FROM tblAdverts)
Upvotes: 1