Listing 2: A Simple Solution to a Non-Standard Sort Problem SELECT * FROM OrderTest ORDER BY len(template_name) , template_name