Im trying to sort a table in order to get the last record.
The following statement …
SELECT * FROM lessons WHERE class=‘DRW’ AND level=‘1’ ORDER BY LENGTH(lesson_code) ASC
produces the following result:
DRW1L1
DRW1L2
DRW1L3
DRW1L4
DRW1L5
DRW1L6
DRW1L7
DRW1L8
DRW1L9
DRW1L10
DRW1L11
DRW1L12
I am trying to get the LAST column in this sort…DRW1L12
When I sort in DESC order I get the following result
DRW1L10
DRW1L11
DRW1L12
DRW1L1
DRW1L2
DRW1L3
DRW1L4
DRW1L5
DRW1L6
DRW1L7
DRW1L8
DRW1L9
I want to use DESC LIMIT 1 in order to get DRW1L12
but instead im getting DRW1L10
Any advice would be appreciate!