I'm on presto and have a date formatted as varchar that looks like -
7/14/2015 8:22:39 AM
I've looked the presto docs and tried various things(cast, date_format, using split_part to parse and then cast) and am not getting this …
Is there any analog of NVL in Presto DB?
I need to check if a field is NULL and return a default value.
I solve this somehow like this:
SELECT
CASE
WHEN my_field is null THEN 0
ELSE my_field
…
I have the following query that I am trying to run on Athena.
SELECT observation_date, COUNT(*) AS count
FROM db.table_name
WHERE observation_date > '2017-12-31'
GROUP BY observation_date
However it is producing this …