On 11/29/19 11:47 AM, Alexander Farber wrote:
Thank you Adrian, but -
if I remove GROUP BY mid, then I get the error:
ERROR: 42803: column "words_moves.mid" must appear in the GROUP BY
clause or be used in an aggregate function
LINE 18: mid,
^
LOCATION: check_ungrouped_columns_walker, parse_agg.c:1369
Yes because it is a case of opposing forces. When you remove mid from
the GROUP BY you get an single row for each group that has an aggregated
output where you can have count of > 1. In that case the database has
more then one choice for the mid to display and so it throws the error.
To go forward it would help to know what it is you are trying to achieve?
Regards
Alex
--
Adrian Klaver
adrian.klaver@xxxxxxxxxxx