Is there a function like that in clickhouse? Similar to mysql's STR_TO_DATE function.
I need to convert '04-Jun-2021' to '2021-06-04'
Is there a function like that in clickhouse? Similar to mysql's STR_TO_DATE function.
I need to convert '04-Jun-2021' to '2021-06-04'
Consider using parseDateTime32BestEffort:
SELECT
'04-Jun-2021' AS str,
parseDateTime32BestEffort(str) AS dateTime,
toDate(dateTime) AS date
┌─str─────────┬────────────dateTime─┬───────date─┐
│ 04-Jun-2021 │ 2021-06-04 00:00:00 │ 2021-06-04 │
└─────────────┴─────────────────────┴────────────┘