Seppo Kuusela Seppo Kuusela - 3 months ago 24
MySQL Question

MYSQL Value error

I have a database with some values, like from 0 to 1 million. However if I want to select the highest value it does not work always, like it can have lower amount first and the big number as you can see on the image.

enter image description here

I have tried

SELECT * FROM listings ORDER BY value DESC
but it does not give the highest value, also with ASC it does not give the lowest value first.

I really hope I can get help from here.

Answer

Here you go:

SELECT * FROM listings ORDER BY length(value) DESC, value DESC
Comments