Forum Replies Created

Viewing 15 posts - 1,531 through 1,545 (of 4,085 total)

  • RE: load data into 3 separate tables using tsql .

    I made a couple of assumptions that may not be accurate, but the following seems to work.  The detail sections have six records where the first character ranges from 1-6;...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Listing records based on condition

    Here is another approach.  My initial testing indicates that it should be faster.


    WITH CTE AS
    (
        SELECT *, MIN(TestResult) OVER(PARTITION BY MemberID ORDER BY CycleID...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Date Ranges - Simple, but seemingly impossible

    Here is an approach that requires one fewer sorts than Chris M.'s method.

    It uses a fairly standard technique for packing intervals developed by Itzik Ben Gan.

    Your...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Adding batch numbers based on row count and column values

    Eirikur Eiriksson - Saturday, November 4, 2017 8:44 AM

    pssudarshan - Friday, November 3, 2017 11:16 PM

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Adding batch numbers based on row count and column values

    Eirikur Eiriksson - Monday, November 6, 2017 9:33 AM

    drew.allen - Monday, November 6, 2017 8:32 AM

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Correct sql for summing a group of records and giving proportion of each value across group

    It's because you're using the wrong PARTITION BY clause.  It's not clear what the correct one is, but you should NOT include Country in the partition.  Also, one of your...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Adding batch numbers based on row count and column values

    Eirikur Eiriksson - Saturday, November 4, 2017 1:10 PM

    drew.allen - Saturday, November 4, 2017 9:22 AM

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: SQL Puzzle challenge

    It's asking you to generate two result sets, and you're only generating one.  In trying to combine the two into one, you've added unnecessary complexity to the query.

    Drew

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Row Wise Balance

    jagjitsingh - Saturday, November 4, 2017 8:01 AM

    Hi

      Closing Balance is o.k But row wise Opening to be added only once ....

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Adding batch numbers based on row count and column values

    It's probably easier to just process them in batches rather than run through them to add batch numbers and then run through them again to process them.  Here is an...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: a sub query filter

    There are two main approaches.  Which one performs better depends on the density of table 2 with respect to table 1 and to a lesser extent on how many records...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: How to use inner join inside Select using case?

    There are actually a couple more options, but the one that you were likely looking for is called a correlated subquery.  The subquery can reference values from the outer query,...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: CTE - Cursor - Try Catch

    rxm119528 - Friday, November 3, 2017 12:34 PM

    Thank you. I do agree that cursors are bad but just trying to understand...

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: CTE - Cursor - Try Catch

    rxm119528 - Friday, November 3, 2017 11:56 AM

    Phil Parkin - Friday, November 3, 2017 11:39 AM

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

  • RE: Min not working for ROW_NUMBER

    nicolestrain07 - Friday, November 3, 2017 9:02 AM

    drew.allen - Friday, November 3, 2017 8:50 AM

    J. Drew Allen
    Business Intelligence Analyst
    Philadelphia, PA

Viewing 15 posts - 1,531 through 1,545 (of 4,085 total)