Answer the question
In order to leave comments, you need to log in
Why does ORDER BY DESC in mysql not work 100% of the time?
There is a database with the INTEGER type, different values are entered there by first reducing them to 2 characters after the comma: .
There are both negative and positive values, 0 is also present, but there are no empty "Null" cells.
The crux of the problem: when usingprice = float("%.2f" % pricemore)
cursor.execute("SELECT * FROM table WHERE status = '1' ORDER BY price DESC ")
la = cursor.fetchall()
Answer the question
In order to leave comments, you need to log in
ORDER BY DESC always works unambiguously and in 100% of cases.
if it is not: the problem is on the receiving side.
Lelouch Lamperouch ,
And further lewdness with the data obtained
And is there any analogue from the python side, so that it sorts by the base, and not the base itself, because As mentioned above, it crashes.
Recheck that the type of the field is really numeric and not, for example, varchar (although if there are numbers, then this should not change anything)
Recheck that the database is not damaged, can you just recreate the index?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question