How to ORDER BY a field consisting of digits following by alphabets in MySQL? -


how order field consisting of digits following alphabets, such 10s, in mysql? desired order is:

  • digits, e.g., 10
  • digits+alphabets, e.g., 10s

for instance,

# original data: 1 10 105 109 10s  # desired results 1 10 10s 105 109 

try this:

select values table order cast(values unsigned), values; 

Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -