Browse by Tags

All Tags » cte (RSS)

Set-based approach to finding consecutive records

I'm sure I've written about this before, but it comes up so regularly in the newsgroups that I thought I'd write an answer here. A table (probably an audit table) exists with a field that stores a date signifying when a change was made. You need to return...
Posted by Rob Farley | 1 comment(s)
Filed under: ,

Faster binary converter - where do your solutions come from?

Mitch Wheat is a great guy. He really is. And he's clearly a mathematician. I mean, I did a half-major as part of my BSc, doing a handful of 3rd year Pure Maths subjects (which I got HDs in too - I wasn't just sleeping during class), but Mitch...
Posted by Rob Farley | 1 comment(s)
Filed under: , ,

Simple recursive CTE

I like CTEs . Mostly because it lets me have a derived table that I can refer to multiple times. I don't often use the recursive features of it. But when I do, I repeatedly feel amazed at the power available. Today I had a challenge to produce a nice...
Posted by Rob Farley | 2 comment(s)
Filed under: ,