บทความ > SQL

[MYSQL] Sorting issue (alphanumeric) Turn Back

เมื่อ 2018-02-08 17:42:11

Wanted:

A1, A2, A3, A4,... Z100

But query with sorting (ORDER BY asc)

A1

A10

A11

..

A2

A21

A22

 

My way to works.

SELECT issue FROM table ORDER BY substr(issue,1,1) ASC, CAST(substr(issue,2) as unsigned) ASC

 

Turn Back

Automotive ดูทั้งหมด

IT Update ดูทั้งหมด