SQL SELECT查询和>平均

时间:2017-05-17 13:04:15

标签: sql ms-access

需要帮助编写查询以选择field_value>所有字段该字段的平均值。例如:

SELECT * WHERE NumWords > "Average of total numwords" FROM tblAdverts;

我尝试了这个查询,但没有运气:

SELECT * 
FROM tblAdverts
WHERE NumWords >(SUM(NumWords/COUNT(AdID)));

1 个答案:

答案 0 :(得分:1)

试试这个:

SELECT * FROM tblAdverts WHERE NumWords >(SELECT AVG(NumWords) FROM tblAdverts)