I have problems when formulating the query that resolves the following. I have a table like for example (illustration). I need to group by the trio of columns that appear in yellow and the fourth column of the query result would be the record that appears first.
...and I need to see the result as follows...
When using
DISTINCT ON
, the query takes the first:Example on rextester.com
If it is as you explain in the image, since you do not give more data, it would be something like:
Try this way, any questions or suggestions comment. slds...