Postgresql – Order by case statement that extracts substring from column
I have the below SQL that takes only data from the Name column up to the point where a space or hyphen appears. I would like to order the results by the output of the case statement but can't find…