Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

Learn more about Collectives

Teams

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Learn more about Teams Please provide sample data and desired results and an explanation of what you want to do. The query doesn't make sense. Gordon Linoff Apr 21, 2021 at 0:19 This is the ERROR message I keep receiving. This is what i'm trying to do List all Products with a total quantity sold greater than the average quantity sold. 20:11:40 SELECT * FROM PRODUCT WHERE P_CODE = (SELECT P_CODE FROM LINE WHERE LINE_TOTAL > AVG(LINE_TOTAL)) LIMIT 0, 1000 Error Code: 1111. Invalid use of group function 0.000 sec Bri S Apr 21, 2021 at 0:21 @Renat I saw that but I was confused as to what to Group By I tried adding HAVING but that did not help Bri S Apr 21, 2021 at 0:30 WHERE P_CODE in (SELECT P_CODE FROM LINE WHERE LINE_TOTAL > (select AVG(LINE_TOTAL) from LINE)

Thanks for contributing an answer to Stack Overflow!

  • Please be sure to answer the question . Provide details and share your research!

But avoid

  • Asking for help, clarification, or responding to other answers.
  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers .