I am trying to select all the columns which will be the same based on the grouping
test_table
+------+-------+---------+----------+-----------+--------------+
| age | name | score | col1 | col2 | col3...col50 |
+------+-------+---------+----------+-----------+--------------+
| 20 | joe | 10 | DING | DONG | col3...col50 |
+------+-------+---------+----------+-----------+--------------+
| 20 | joe | 20 | DING | DONG | col3...col50 |
+------+-------+---------+----------+-----------+--------------+
| 22 | sue | 25 | SING | SONG | col3...col50 |
+------+-------+---------+----------+-----------+--------------+
| 22 | sue | 10 | SING | SONG | col3...col50 |
+------+-------+---------+----------+-----------+--------------+
| 50 | bob | 25 | RING | WRONG | col3...col50 |
+------+-------+---------+----------+-----------+--------------+
| 44 | joe | 15 | THING | THONG | col3...col50 |
+------+-------+---------+----------+-----------+--------------+
The output that I am looking for would be:
+------+-------+---------+----------+-----------+--------------+
| age | name |sum(score| col1 | col2 | col3...col50 |
+------+-------+---------+----------+-----------+--------------+
| 20 | joe | 30 | DING | DONG | col3...col50 |
+------+-------+---------+----------+-----------+--------------+
| 22 | sue | 35 | SING | SONG | col3...col50 |
+------+-------+---------+----------+-----------+--------------+
| 50 | bob | 25 | RING | WRONG | col3...col50 |
+------+-------+---------+----------+-----------+--------------+
| 44 | joe | 15 | THING | THONG | col3...col50 |
+------+-------+---------+----------+-----------+--------------+
I know this isn't right, but my the general thought process is:
select
min(*),
sum(score)
from test_table
group by age, name
I want to avoid doing something like:
select
min(col1),
min(col2),
... cont ...,
min(col50),
sum(score)
from ...