Skip to content
Advertisement

Average of Sum minus Minimum

I have an SQL statement that grabs the grades of different activity types (Homework, Quiz, etc), and if there’s a drop lowest for that type, it drops, else, it remains. The errors are below as well as the SQL Code.

Here are the errors I’m getting:

Advertisement

Answer

Look into analytical functions. (SO question, Oracle documentation).

Something like this:

and:

Set the partitioning with whatever makes sense in your case; we can’t tell since you omitted the FROM ... in your example.

You can then use those column aliases in any calculations inside your CASE statement.

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