W
W
why72016-04-12 19:21:14
PHP
why7, 2016-04-12 19:21:14

postgresql. Is it possible to sort like this?

For example, there is such data in the table:

idnameage
oneVasya40
2Petyafifteen
3Kolyafifteen
4Svetathirty
5Mashathirty

Is it possible only by means of the DBMS to sort the selection so that first there are records with age = 30, and then all the rest?
UPD: Option ORDER BY age = 30 DESCA works correctly and then you can sort by other fields as needed.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Melkij, 2016-04-12
@why7

order by age = 30, name
Maybe age = 30 DESC, I always confuse them

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question