Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8343441
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T06:03:52+00:00 2026-06-09T06:03:52+00:00

I have a question. This is the query : SELECT a.naam as Artiest, SUM(o.numberOfOrders)

  • 0

I have a question.

This is the query :

SELECT a.naam as "Artiest", SUM(o.numberOfOrders) as "Aantal singles",   
(SUM(o.numberOfOrders) * s.price) * 0.35 as "Winst  

FROM orders o
JOIN singles s ON s.singleid = b.singleid
JOIN artist a ON a.artistid = s.artistid
WHERE b.date= TO_DATE('15/MAY/2012','dd/mon/yyyy')
GROUP BY a.name

When I execute this query I get the error :

“not a GROUP BY expression”

I’ve already tried putting (SUM(o.numberOfOrders) * s.price) * 0.35 in the group by as well,
but then I get the error:

“group function is not allowed here”

How do I fix this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T06:03:55+00:00Added an answer on June 9, 2026 at 6:03 am

    You want to replace this with one of the following:

    sum(o.numberOfOrders*s.price)*0.35
    

    or:

    sum(o.numberOfOrdrs)*avg(s.price)*0.35
    

    or (maybe):

    sum(o.numberOfOrdrs)*max(s.price)*0.35
    

    In other words, s.price is not in the group by

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this query: SELECT p.text,se.name,s.sub_name,SUM((p.volume / (SELECT SUM(p.volume) FROM phrase p WHERE p.volume
I have this query in MySQL: SELECT pr.*, pr7.value AS `room_price_high` FROM `jos_hp_properties` pr
This is a follow on from another question i made I have this query
I have this query SELECT Calendar.Production Week FROM Opex WHERE ( Calendar.Production Week BETWEEN
This is my base query select distinct a.projects , case when(billing_fy!=0) then(select round(((sum(cost_project)/(sum(billing_fy)/((10/12)*365)))),2) from
Suppose I have this query SELECT * FROM ( SELECT * FROM table_a WHERE
I have this query select movie_name, user_name from movie natural join movie_queue natural join
I have this query: SELECT count(member_id) FROM member_favorite_business WHERE business_id=3912 AND member_id=413 When I
I have this query in my PHP: <?php $comments_list = mysql_query(SELECT * FROM comments
I have this question, just in theory. I do some query results and there

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.