# How to make the arithmetic mean in the SQL query?

How to make secondary arifmeticheskoe `stud`.`E1`, `stud`.`E2`, `stud`.`E3` and the lines, as it is now, and for the columns to get one number?
SELECT `stud`.`Name`
FROM `stud`
WHERE EXISTS(SELECT NumS
FROM `rob_gurt`
WHERE
((`stud`.`NumS` = `rob_gurt`.`NumS`) AND (`rob_gurt`.`NumG` = 1) AND ( `stud`.`E1`<=
(`stud`.`E1` + `stud`.`E2` + `stud`.`E3`)/3) )
)
August 23rd 19 at 10:43
August 23rd 19 at 10:45
Solution
SELECT `stud`.`Name`
FROM `stud`
INNER JOIN
(SELECT AVG(`stud`.`E1` + `stud`.`E2` + `stud`.`E3`) / 3 AS average
FROM `stud`
INNER JOIN `rob_gurt`
ON `rob_gurt`.`NumS` = `stud`.`NumS`
INNER JOIN `gurt`
ON `gurt`.`NumG` = `rob_gurt`.`NumG`
WHERE `gurt`.`NameG` = 'Musical') AS q
ON `stud`.`E1` <= q.average
August 23rd 19 at 10:47
See hard you session is taking place. AVG() in the help.
: Yes, guys. Session is not like Boobs crush. Hard to exercise - easy in battle! - Kieran_Goodw commented on August 23rd 19 at 10:59
AVG on the column, finds, and here I see the need for 3 columns in one row - daniella.Gibson commented on August 23rd 19 at 10:50
: No, I have 3 columns and rows, and with those filters is that there is - benton87 commented on August 23rd 19 at 10:53
Razbiratsya quite difficult - benton87 commented on August 23rd 19 at 10:56

Find more questions by tags DatabasesMySQLSQL