Answer the question
In order to leave comments, you need to log in
How to sort by field in PostgreSQL using DISTINCT?
There is a request:
SELECT DISTINCT field_1, field_2 FROM table_1 ORDER BY field_3
SQLSTATE[42P10]: Invalid column reference: 7 ERROR: for SELECT DISTINCT, ORDER BY expressions must appear in select list
Answer the question
In order to leave comments, you need to log in
And how do you imagine sorting by a field that is missing?
Here you have a sign
name value
aaa 111
aaa 222
bbb 156
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question