Hey guys I am trying to fill a column based on certain criteria from 4 columns.
I think it would be best to do this in another column so that I'm not overwriting anything.
My table looks like the following and I'm trying a Case Statement that fills in the null spaces, but I think my case statement is missing something or I'm missing a step.
publish_date | date_created | time_created | date_updated | time_updated |
04/30/2020 | 04/30/2020 | 18:37:06 | 04/30/2020 | 18:37:06 |
04/30/2020 | 04/30/2020 | 18:38:06 | 04/30/2020 | 18:38:06 |
| 04/30/2020 | 17:09:29 | 04/30/2020 | 17:09:29 |
04/30/2020 | 04/30/2020 | 18:37:08 | 04/30/2020 | 18:43:11 |
| 04/30/2020 | 19:06:07 | 04/30/2020 | 19:06:07 |
04/30/2020 | 04/30/2020 | 18:37:08 | 04/30/2020 | 18:43:11 |
| 04/30/2020 | 12:00:33 | 04/30/2020 | 12:00:36 |
04/30/2020 | 04/30/2020 | 18:38:05 | 04/30/2020 | 22:31:32 |
My case statement looks like this so far:
CASE when `date_created`=`date_updated` and `time_created`=`time_updated` and `publish_date` IS NULL then `date_created` else `publish_date` end
Unfortunately my case statement sucks and this doesn't work to my advantage.
Can anyone help?