I'm creating live score for dragracing competition. I've got table in database
id time
k2 16,010
k4 15,11
k25 15,819
k26 15,114
z27 19,696
I need to get that table in reverse order by id
.
For example, if select SELECT id FROM online order by id desc
the result would be sorted as a string
.
id
k9
k8
k7
k6
k5
k4
k3
k17
k16
k15
k14
I need 17-14-9-4
Upd. THANKS FOR ALL!!! This one helped
SELECT CAST( replace( id, 'k', '' ) AS SIGNED ) AS sort
FROM online
ORDER BY `sort` DESC