I have a table in AWS Redshift as below picture:

[![enter image description here](https://i.stack.imgur.com/oSqcB.png)](https://i.stack.imgur.com/oSqcB.png)

Below is the SQL query I am using to move data from one table to another. The issue happening is as you can see from table for one day there are multiple values with different time stamp and I just want one value for each day in the results table "test\_dcm.mediacost\_latest" . What condition should I use for the "date" so that SQL query just picks one value for each day?

```
INSERT INTO test_dcm.mediacost_latest (campaign, mediacost, recent_sdc_report_time)
SELECT campaign, mediacost, _sdc_report_time
FROM test_dcm_test_report
WHERE date='????????????';

```