Skip to content
Advertisement

Can you help me to correct this query in sql

ERROR at line 1:
ORA-00979: not a GROUP BY expression

Advertisement

Answer

You are getting this error for WEIGHT_IN_PERCENTAGE. If WEIGHT_IN_PERCENTAGE is same for every row in a group you can use (SUM(POINTS) * max(WEIGHT_IN_PERCENTAGE)) or you can SUM(POINTS*WEIGHT_IN_PERCENTAGE) multiply it with POINTS before sum:

OR

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement