We can try using the `ASCII`

function here along with a `CASE`

expression:

```
SELECT mycol
FROM mytable
ORDER BY
CASE WHEN LEFT(mycol, 1) LIKE '[A-Z]' THEN 0 ELSE 1 END,
LEFT(mycol, 1),
CASE WHEN RIGHT(mycol, 1) LIKE '[A-Z]' THEN 0 ELSE 1 END,
RIGHT(mycol, 1);
```

The logic here uses four levels of sorting, a pair for each of the two characters in `mycol`

. The `CASE`

expressions put letters before numbers. After this, we simply sort ascending by number or letter.

One other approach to this would be to treat your column as a base 36 number (10 digits plus 26 letters), and then just sort based on that number converted back to a base 10 decimal. But, this might be uglier and more convoluted than the solution I posted above.

`'ZZ'`

(actually, think it would be`'99'`

)? – Larnu Apr 11 at 14:12`11`

or`2A`

? (Because 11 is numerically larger than 2...) – Bart Hofland Apr 11 at 14:23