How to get highest bonus and second highest bnus paid freelancer for each group

  • Phil Parkin wrote:

    PasLe Choix wrote:

    Thanks John,

    DENSE_RANK() is an analytical function

    No it isn't, it's a Window function.

    John already provided a link to analytic functions. Had you followed it, you would have seen that DENSE_RANK() does not appear there.

    maybe this is debatable:

    https://technology.amis.nl/2004/09/29/analytical-sql-functions-theory-and-examples-part-1-on-the-partition-clause/

    This post treats all Ranking Functions as analytical functions.

    Thank you anyway.

  • PasLe Choix wrote:

    maybe this is debatable:

    https://technology.amis.nl/2004/09/29/analytical-sql-functions-theory-and-examples-part-1-on-the-partition-clause/

    This post treats all Ranking Functions as analytical functions.

    Thank you anyway.

    That post is from 2004, it's almost 16 years old and based on SQL Server 2000 Oracle... None of the Analytic functions even existed in 2004; most of them were brought in 8 years later in SQL Server 2012. To put it bluntly, it's wrong (as DENSE_RANK has never been an analytic function, it's a ranking function) and it's very outdated.

    It's not something that can be debated, as it's very (well) documented what is (and therefore isn't) an analytic function.

    Thom~

    Excuse my typos and sometimes awful grammar. My fingers work faster than my brain does.
    Larnu.uk

  • Thom beat me to it!

    microsoft.com vs amis.nl ... I know which source I'm going with.

     

    If you haven't even tried to resolve your issue, please don't expect the hard-working volunteers here to waste their time providing links to answers which you could easily have found yourself.

  • Thom A wrote:

    That post is from 2004, it's almost 16 years old and based on SQL Server 2000... None of the Analytic functions even existed in 2004; most of them were brought in 8 years later in SQL Server 2012. To put it bluntly, it's wrong (as DENSE_RANK has never been an analytic function, it's a ranking function) and it's very outdated.

    OK, thank you for indicating that. I left SQL for couple years, not aware of that.

  • Phil Parkin wrote:

    Thom beat me to it!

    microsoft.com vs amis.nl ... I know which source I'm going with.

    Haha, thank you Phil and please don't get panic on me, happy new year

     

  • Actually I just noticed that post is about PL/SQL and Oracle, not SQL Server. What SQL Server and Oracle call Analytic Functions could be different, as same named functions may not behave the same. So it's not based on an old version of SQL Server; it's not base on SQL Server at all.

    Thom~

    Excuse my typos and sometimes awful grammar. My fingers work faster than my brain does.
    Larnu.uk

  • PasLe Choix wrote:

    Haha, thank you Phil and please don't get panic on me, happy new year

    Panic over 🙂 Happy new year to you too.

    If you haven't even tried to resolve your issue, please don't expect the hard-working volunteers here to waste their time providing links to answers which you could easily have found yourself.

  • Thom A wrote:

    Actually I just noticed that post is about PL/SQL and Oracle, not SQL Server. What SQL Server and Oracle call Analytic Functions could be different, as same named functions may not behave the same. So it's not based on an old version of SQL Server; it's not base on SQL Server at all.

    Hi Thom, I could definitely do everyone here especially you a free lunch for picking up the needle in a hay, haha, thank you my friend, you have eagle-like sharp eyes.

     

  • People often confuse the window and analytical functions, which is what I would have asked. Often the code might need to be pre-2012, so using the OVER() with windowing functions isn't required.

    I suspect this is some puzzle question to get someone to think without using any analytical functions, which is good for learning, not so good for prod code.

Viewing 9 posts - 16 through 23 (of 23 total)

You must be logged in to reply to this topic. Login to reply