'How can I select all the column with the last date
I would like to select all the columns ("user", "status, "tool", "date") of the dataset which has the last date and transform the date. I transform the date ie CAST (date AS DATE)
| user | status | tool | date |
|---|---|---|---|
| ID | simple | tol1 | 20200120 |
| ID | simple | tol2 | 20210518 |
| ID | simple | tol3 | 20210430 |
| ID | simple | tol8 | 20220315 |
| ID | simple | tol0 | 20190513 |
I obtain this final dataset :
| user | status | tool | date |
|---|---|---|---|
| ID | simple | tol8 | 2022-03-15 |
This is my code by I don't take the first
SELECT "user", "status", "tool", CAST(date AS DATE) AS date_new
FROM table
ORDER BY date_new DESC
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
