Skip to content
Advertisement

I’m trying to know the country that pays the highest salary from

Advertisement

Answer

Code you posted wouldn’t compile; it lacks LAST_NAME in the GROUP BY (which is, basically, wrong as it would make what you’re doing impossible) or – a better idea – remove it from the SELECT statement’s column list.

Using RANK analytic function, you’d then have


I don’t have your tables nor data so – for illustration – I’ll use Scott’s sample schema. Simplified, it would be like this:

So:

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