Forum Replies Created

Viewing 15 posts - 1 through 15 (of 25 total)

  • RE: Efficient way to count distinct

    ScottPletcher - Thursday, July 5, 2018 9:23 AM

    ollyjolly - Thursday, July 5, 2018 9:14 AM

  • RE: Efficient way to count distinct

    ScottPletcher - Thursday, July 5, 2018 9:02 AM

    ollyjolly - Thursday, July 5, 2018 8:56 AM

  • RE: Efficient way to count distinct

    Jeff Moden - Thursday, July 5, 2018 8:48 AM

    ScottPletcher - Thursday, July 5, 2018 8:30 AM

    July 5, 2018 at 9:07 am

    #1996416

  • RE: Efficient way to count distinct

    ScottPletcher - Thursday, July 5, 2018 8:30 AM

    Before loading the #Paid table, cluster it on all the GROUP BY columns:

    Yr
    ...

  • RE: Efficient way to count distinct

    Ok thanks Jeff.

    With regard to Paul's code or the Cross Apply you have to pardon my ignorance as I have not used either before. So using my prior query...

  • RE: Efficient way to count distinct

    As in a select of the 60 million rows without any DISTINCT or group by from the #Paid temp table?

    As I am using a temp table to pull...

  • RE: Efficient way to count distinct

    Jeff I will certainly look info this. I know the process with my IT department to get something through code review and in to production is a very long process.

  • RE: Efficient way to count distinct

    As I was afraid....it looks like I am limited to SELECT permission. Attempted to create a view and got the dreaded....

    CREATE VIEW permission denied in database

  • RE: Efficient way to count distinct

    Thank you Jeff. I will look through the information on indexed views and attempt to implement. I also need to make sure that I have permissions to create views. If...

  • RE: Determine where a value falls between ranges to assign points

    After reading some other forum posts I am thinking that I might be able to write the metric ranges (High, Mid-High, Mid-Low, and Low) to variables. Would that be the most efficient...

  • RE: Using a case statement to determine join

    I apologize if I did not providing enough information. By not working I mean I am getting an error stating "incorrect syntax near the keyword group".

    To demonstrate the error I have put...

  • RE: Most efficient join

    frederico_fonseca - Tuesday, October 3, 2017 3:52 PM

    If you can't do explain plans better ask your DBA's to give you that -...

  • RE: Most efficient join

    sgmunson - Tuesday, October 3, 2017 3:13 PM

    Try this on for size:SELECT DISTINCT D.Id, D.Nbr, D.Unit_Total, D.Type_Code, D.Serv_Code, D.Pro_Code, D.Pro_Mod,
        (
            SELECT CONVERT(money, SUM(C.paid_amt))
            FROM...

  • RE: Most efficient join

    Unfortunately, my permissions do not allow me to get the query execution plan otherwise I would provide. The #Product table has one record per Id. The Detail and Payment tables...

  • RE: Optimize query that is using like statements

    That is why I was hoping that I could put the values from the LIKEs in a temp table, and then incorporate it into the join as the values versus...

Viewing 15 posts - 1 through 15 (of 25 total)