The DBMS is the one actually doing the ordering (sorting). The SQL statement can only request ORDER BY against a column name -- not a portion of a column. Your only option is to retrieve the data, parse it yourself for the desired portions, and sort on those in your Macintosh application.