You have a table with employee payment, you have to select employee with less payment than average. I tried the following command: SELECT username FROM users WHERE payment < AVG(payment) ERROR #1111 - invalid use of group function
3/23/2018 1:39:04 PM
Akib5 Answers
New AnswerWell, just found the answer. That would be SELECT username FROM users WHERE payment<(SELECT AVG(payment) FROM users) **IF anyone knows a better /easier way let me know.
SELECT username FROM users WHERE payment<(SELECT AVG(payment) FROM users) **This is the simplest command you can find out there unless you want to group the observations and then use the HAVING clause.
Sololearn Inc.
535 Mission Street, Suite 1591Send us a message