• There are multiple different ways to do this.

    Rank or row number

    Max in a subquery and join to it

    Top 1 in a cross apply

    All will likely be way faster than a triangular join. Which is best among them often depends on the volume and distribution of the data

    As for comparing performance characteristics, if you want to see which run faster, which uses less CPU, then see which runs faster and uses less CPU. The execution plan shows estimated costs of operators and procedures, not durations and CPU.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass