I have a table where one of the columns may have duplicate entries, and I want to condense each set of duplicates into a single row, with an aggregate function applied to the other columns. I cannot think of a sensible explanation of this, so here is an example data table and result table
+------------------------+--------------------+
| column_with_duplicates | column_to_aggregate|
+------------------------+--------------------+
| 1 | 1 |
| 1 | 2 |
| 2 | 3 |
| 3 | 4 |
| 3 | 5 |
| 3 | 6 |
+---------------------------------------------+
output
+------------------------+--------------------+
| column_with_duplicates | column_to_aggregate|
+------------------------+--------------------+
| 1 | 1.5 |
| 2 | 2 |
| 3 | 5 |
+---------------------------------------------+
All of the rows where column_with_duplicates
is 1
had column_to_aggregate
averaged together into a result row. The same happened for all values of column_with_duplicates
Since I had so much difficulty describing this, I couldn't effectively research the issue.