I want to sort the following data items in the order they are presented below (numbers 1-12):
1 2 3 4 5 6 7 8 9 10 11 12
However, my query - using
MySQL ORDER BY Sorting alphanumeric on correct order
example:
SELECT `alphanumericCol` FROM `tableName` ORDER BY SUBSTR(`alphanumericCol` FROM 1 FOR 1), LPAD(lower(`alphanumericCol`), 10,0) ASC
output:
1 2 11 21 100 101 102 104 S-104A S-105 S-107 S-111