M
M
Matthew Stafford2019-11-03 15:19:47
SQL
Matthew Stafford, 2019-11-03 15:19:47

Why is it not sorting the elements correctly?

SELECT `username`, `online`
FROM `moders`
WHERE `date` = '03.11.2019'
ORDER BY `online` DESC
LIMIT 0 , 30

And here is what I get
jxtfwpe.png
Why is this and how to fix it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Matthew Stafford, 2019-11-03
@matthewstafford

And that's it, I solved the problem myself ... The field type was `varchar`, changed to `int` and now it's normal to sort.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question