Alphabetical SQL order without leading zeros for numbers less than 10

Is it possible to alphabetize in mySQL as follows:

A1
A2
A3
A5
A10
A11
A20
A23
A24

Unfortunately, the order I get is ordered as shown below. Please note that any number up to A10 is not grouped together?

A1
A10
A11
A12
A2 <A2
A20
A23
A24
A3 <A3
A5 <A5

: - , A01, . , , , . , - , .

+3
4

, . , .

...
ORDER BY SUBSTR(postalcode,2)+0
+3

UDF, varchar . ORDER BY .

, - ASCII A ( ) * 100 + varchar.

+5

, , . , , : NC27605. zip_code , - . , zip_code.

; .

0

.

, . , ASC DESC .

MySQL, New Riders, 2000, Paul DuBois ( )

MySQL 3.23.2, . , `ORDER BY RAND()

- , , varchar , ORDER BY? ?

, , .

0
source

Source: https://habr.com/ru/post/1727577/


All Articles