I'm looking for a way to display a column in my table without aggregating it (column store
)
SELECT id, name, max(cost), store
FROM test
group by 1,2,4
But in the table im using there are some row that shares the same id,name,license with different machine, and Ideally I'd like to get in return only a single row, with max(cost)
, if they share the same first 2 columns and only display the last column - without using it to group by.
actual outcome:
id | name | max(cost) | store |
---|---|---|---|
1 | Joe | 30 | store1 |
1 | Joe | 50 | store2 |
but my desired result will be:
id | name | max(cost) | store |
---|---|---|---|
1 | Joe | 50 | store2 |
Can it even be done?