E
E
Evgeniy V.2019-02-27 17:09:49
Microsoft Access
Evgeniy V., 2019-02-27 17:09:49

How to display the number of records whose values ​​are above the average?

Task: the number of students whose score is above the average for the faculty

SELECT Count(*) AS [count], Round(Avg(People.[Средний балл последней сессии]), 1 ) AS AvgP
FROM People
WHERE (((People.[Средний балл последней сессии]) > AvgP));

Such a code in an SQL query inside Access asks to enter AvgP, how to make the query work with AvgP as an average

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Artyom Karetnikov, 2019-02-28
@art_karetnikov

You cannot use an alias. In WHERE use full function. And are you sure you need WHERE, not HAVING?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question