Alternatives
Members may post updates or alternatives to this current article in order to show different
approaches or add new features.
7 Jan 2012Jörgen Andersson
Pretty cool little trick you've made there.With the help of an analytic function, I've fixed the ordering, and as a byproduct it also scales better:WITH ranked AS ( SELECT make,model,Rank() over (PARTITION BY make ORDER BY model) Rnk FROM MakeModel ),cte...