How to get the largest value with the longest length in mysql in order by desc?

0

I have a sequence of values, for example:

w1-16
w2-16
w3-16
w4-16
w5-16
w6-16
w7-16
w8-16
w9-16
w10-16
w11-16 

There you go.

I made a query that takes the correct sequence as above. Example:

select week from tabela where group by week order by length(week), week;

I tried to put desc at the end plus everything comes in clutter, I would like to get the highest value with the longest length as in the example of the sequence above the value w11-16 the last value is not fixed it can change in case of insertion in the table does anyone know a way to do this?

    
asked by anonymous 09.11.2016 / 13:49

0 answers