I want to run a SQL query on the following set of data
date creation_date value ------------------------------------ 2018-01-01 2017-05-05 1 2018-01-02 2017-05-05 0 2018-01-03 2017-05-05 1 2018-01-04 2017-05-05 0 2018-01-05 2017-05-05 1 2018-01-06 2017-05-05 1 2018-01-02 2017-05-11 5 I want to get the following results
2018-01-01 2017-05-05 1 2018-01-02 2017-05-11 5 2018-01-03 2017-05-05 1 2018-01-04 2017-05-05 0 2018-01-05 2017-05-05 1 2018-01-06 2017-05-05 1 Basically I want to get all the dates, group it by dates and get the latest creation date and get the value for that creation date.
I tried
select date, max(Creation_date), value from datasource group by date, blocked but that doesn't do it.
Creation_Date?