Erland Sommarskog (9/2/2013)
I assume that you mean set-based iteration. That is by no means an atypical method, but one a good SQL programmer should master.
Yes and absolutely agreed. That's why I called it atypical though. 😉
Of course, for this particular problem, the correct solution is an ordered aggregate. No that is not possible on SQL 2008, but it's reasonable to assume that a class would teach from the most recent version. At least if the features are ANSI-compatible.
I guess "possible" depends a lot on whether or not you consider the "Quirky Update" to be a form of ordered aggregate or not but I do get your point. As reasonable as it sounds, though, I would't assume that any given class has been updated to the latest version epecially when the OP posted in a 2008 forum.
--Jeff Moden
Change is inevitable... Change for the better is not.