SQL Language (MOSC)

MOSC Banner

Strange result of analytic aggregate (min/avg/max) using order by

edited Feb 13, 2018 7:35AM in SQL Language (MOSC) 5 commentsAnswered ✓

Hello

I have a hard time understanding the results of the query below. It uses the classic scott.emp table.

The result of the min function with a partition by and an order by are strange. The other two analytic calculated columns make perfect sense. I would think adding a (redundant) order by to the column aliased Min_sal2 should not change the result of the min-function. But it does. I know,  the order by is not needed for min (or max or avg), but I would not expect it to ruin the result. Can anyone explain?

I am on 12.2.0.1, not that I think this has anything to do with it.

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center