I have two row in a table such as:
Code | Amount | TimeStamp |
---|---|---|
1 | 100 | 2022-08-02 16:47 |
1 | 105 | 2022-08-02 16:15 |
2 | 105 | 2022-08-02 16:15 |
I want max timestamp single row as output as:
Code | Amount | TimeStamp |
---|---|---|
1 | 100 | 2022-08-02 16:47 |
2 | 105 | 2022-08-02 16:15 |
my code:
select code, amount, max(timeStamp) from table
group by code, amount