1
Table: PEOPLE
id - nome
1 - BEATRIZ
2 - MARIA
3 - CARLOS
4 - MARIA
5 - JÉSSICA
6 - HENRIQUE
How do I make a SELECT
that gives me as a result a list of the names ordered by ID descendente
, however, a given NAME first and below the continuation?
Type: first the MARIAS and below the continuation in alphabetical order and ID DESC.
SELECT * FROM PESSOAS WHERE nome='MARIA' OR nome!='MARIA' ORDER BY nome, id DESC
Thus not from error, but from query
returns me the list normally ordered only by id DESC
and not with the name MARIA at the top of the list.
nome='MARIA' OR nome!='MARIA'
this is quite wrong, nor needed this WHERE, it is the same thing as nothing. But I will answer your question– Leonardo Bonetti
Possible duplicate of How to sort the data of a query by predefined values?
– Jéf Bueno
"MARY" has to be the first name or is it to list first all the lines that the term "MARY" is part of the name? // The name column has only one term?
– José Diz
@Cicero which bank you use?
– Jéf Bueno