Forum Replies Created

Viewing 15 posts - 181 through 195 (of 395 total)

  • RE: Windowing function puzzle

    Jeff Atherton - Friday, March 3, 2017 7:12 AM

    Window functions are only allowed in the SELECT and ORDER BY clause. So if...

  • RE: Windowing function puzzle

    Mark Cowne - Friday, March 3, 2017 7:03 AM

    You can use


    DENSE_RANK() OVER(PARTITION BY ColumnA ORDER BY ColumnB) +
    DENSE_RANK() OVER(PARTITION BY ColumnA ORDER...

  • RE: Windowing function puzzle

    Actually, let me clarify it a bit more and simplify the situation more succinctly:

  • RE: Windowing function puzzle

    sgmunson - Thursday, March 2, 2017 8:32 PM

    Why not use a windowed version of COUNT?

    SELECT a.*
    FROM dbo.ComplexQuery AS a
    WHERE COUNT(DISTINCT ColumnD) OVER(PARTITION...

  • RE: Windowing function puzzle

    Eddie Wuerch - Thursday, March 2, 2017 8:27 PM

    You've basically hand-coded a DENSE_RANK() ... WHERE MAX(<DENSE_RANK() value>) = 2. The sample data...

  • RE: The Multilingual Programmer

    While I've most likely forgotten a number of them, these are the ones that stick out in my mind most readily:

    BASIC (DEC...

  • RE: Query Performance Tuning – A Methodical Approach

    GilaMonster - Friday, February 10, 2017 2:13 PM

    No. those two queries are completely identical in results and performance.

    If, however,...

  • RE: Query Performance Tuning – A Methodical Approach

    Since Steve was kind enough to re-post this in today's daily email, I just now was able to read this posting.  Nice job Gail!

    While the purpose of the...

  • RE: GetDate() in blocked sessions

    Blech! I knew the right answer but clicked the wrong option. Goes to prove that jumping too quickly to answer without double-checking can be hazardous!

  • RE: Import data in parquet format

    The team did identify a method of pushing the data to SQL Server but this approach requires coordinating the stored procedure execution on SQL Server to occur AFTER the data...

  • RE: Import data in parquet format

    That's the thing I like about you Jeff. You're always full of optimism and hope! 😛

    However, I've not given up hope yet. Who know, since support for XML...

  • RE: Complex foreign key

    Carlo Romagnano (9/22/2016)


    Aaron N. Cutshall (9/22/2016)


    I got the responses correct except that I also included "Command(s) completed successfully." -- which does flash briefly due to the master table creating successfully...

  • RE: Complex foreign key

    I got the responses correct except that I also included "Command(s) completed successfully." -- which does flash briefly due to the master table creating successfully (doing them individually shows that...

  • RE: VALUES limit

    BrainDonor (9/16/2016)


    They are defaults within Tools/Options/SQL Server Object Explorer/Commands (in SSMS 2014 - may be elsewhere in other versions) and therefore configurable.

    This affects the defaults within SSMS sessions for the...

  • RE: Avoiding Stored Procedures

    xsevensinzx (9/1/2016)


    At what point do you stop and launch? When is done, done?

    Don't get me wrong. I'm not saying that we need to spend lots of time in planning...

Viewing 15 posts - 181 through 195 (of 395 total)