August 20, 2010 at 3:13 am
drew.allen (8/19/2010)
Chris Morris-439714 (8/18/2010)
WHERE PartitionSize IN (1, Seq*2, Seq*2-1) -- < changed 3rd param here
Cheers
ChrisM
This makes it seem like 1 is a special case when it's actually an exemplar of Seq*2-1. Including unnecessary elements makes your code harder to understand. Admittedly, it doesn't make that much difference in this case.
Drew
Hi Drew
Thanks for pointing this out, and I entirely agree with your comments. I'd like to say it was deliberate, to catch PartitionSize = 1 with the least effort - which would hold water too - but it wasn't, it was simply scaffolding left over from testing values of partitionsize and seq to capture the correct values.
Cheers
ChrisM
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
Viewing post 16 (of 15 total)
You must be logged in to reply to this topic. Login to reply