SQL Query

  • This was removed by the editor as SPAM

  • This was removed by the editor as SPAM

  • This was removed by the editor as SPAM

  • Steve Collins wrote:

    If performance is a requirement then yes it could be refactored

    Understood.  For me, performance is 2nd only to a correct result... and its a very, very close second and I, having learned many painful lessons about it in the past, always consider performance to be a requirement, whether enunciated or not. 😀

    My recommendation is to assume performance is always a requirement or experience "flooding" when you or the people you work for can least afford for it to happen.

    Thanks for the feedback on the on the AI prompt.  I appreciate it, Steve.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • This was removed by the editor as SPAM

  • Jeff Moden wrote:

    Understood.  For me, performance is 2nd only to a correct result... and its a very, very close second and I, having learned many painful lessons about it in the past, always consider performance to be a requirement, whether enunciated or not. 😀

    My recommendation is to assume performance is always a requirement or experience "flooding" when you or the people you work for can least afford for it to happen.

    Thanks for the feedback on the on the AI prompt.  I appreciate it, Steve.

    Your code sets the standard.  It's a shame AI isn't more of an enhancement for SQL developers.  It's unfortunate actually because the overall impact of AI seems to be a chilling of public discussion on technical issues in general.  The unsaid consensus conclusion seems to be if you don't know something then AI can replace you.  I'm glad to have participated and learned at a time when this was much less the case.  When you create a query how bound are you to select the next word based on the previous?  For me the answer changes with each keyword.  In the SELECT list it's often true but in FROM it's more often not.  Is analyzing the autocorrelation of SQL code a valid method of learning to code in SQL?  Imo LLM is not well suited to relational programming at least so far.  It's good for ginning up data and sample sets

    Aus dem Paradies, das Cantor uns geschaffen, soll uns niemand vertreiben können

  • Thanks Drew, Jeff for highlighting the alternative with DENSE_RANK. Interesting way to handle or exists

  • This was removed by the editor as SPAM

Viewing 8 posts - 16 through 22 (of 22 total)

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