• Alan.B (5/29/2015)

    Take a look at this link: What is the fastest way to calculate the median? Note the comments and links posted by Dwain Camps. Interesting stuff.

    That's actually the same link I mentioned at the end of my post 🙂 and another reminder that just because it's a built-in function that went through Microsoft's QA doesn't mean it's necessarily the most efficient ("YMMV" caveats notwithstanding).

    I have actually been working through one of Ben-Gan's books; I don't have it to hand but believe it's the 2012 T-SQL querying book that complements the foundation of most of the current MS DB qualifications. I'm competent but stuck on 2008R2 so wanted a full run through of 2012's new querying capabilities and to check off anything that I hadn't come across before. I've been slogging through the XML chapters for completeness's sake (ugh) but haven't seen mention of the PERCENTILE_ functions yet so might pick up the functions book as I imagine it would be more in-depth.

    I also just noticed that Dwain put up a post specifically on percentiles a couple of weeks ago which I missed while I was away; it didn't come up through my Googling earlier in the week but it's on the SSC front page at the moment. Wish I had more of a head for maths!