0
I have these names on my chart:
nome ----- A B C D E F
If I do:
SELECT nome FROM tabela
he will return me "A, B, C, D, E, F".
I’d like you to return me backwards, from the last record to the first.
F, E, D, C, B, A.
How could I?
0
I have these names on my chart:
nome ----- A B C D E F
If I do:
SELECT nome FROM tabela
he will return me "A, B, C, D, E, F".
I’d like you to return me backwards, from the last record to the first.
F, E, D, C, B, A.
How could I?
4
You can order your return through the order by
:
SELECT nome FROM tabela ORDER BY nome DESC
but I wouldn’t necessarily like to order them from Z to A. I would just like to take from the last record to the first.
then the ordination must be done by id
, instead of the name? is that?? ie order from the greatest to the least id rather than alphabetical order?
Makes sense, I traveled kkk. Thanks!
@dds, one of the solutions is to use the id
, if it is auto_increment, or else create a field with the registration date, but the only sorting method for what you requested is using the order by
, only has to see the field(s) (s) you wish to order.
Browser other questions tagged mysql sql database
You are not signed in. Login or sign up in order to post.
SELECT FROM table name order by DESC name
– user60252
your question is misspelled. If the order of names is
A B F C D E
nororder by nome DESC
nororder by id DESC
will return the desired. Now, if the entry order in the table is alphabetical, either by name or DESC id– user60252