Home > OS >  Cast timestamp to String in presto MySQL?
Cast timestamp to String in presto MySQL?

Time:11-10

How can I cast a timestamp column to string to do wildcard operations in Presto MySQL?

I have used the following command: CAST(time_at as char(100)) LIKE '2019-10-31%'

Getting an error: Presto error: TYPE_MISMATCH: line 120:8: Cannot cast timestamp to char(100)

CodePudding user response:

Use VARCHAR:

select CAST(timestamp '2019-10-31 01:00'  as VARCHAR) LIKE '2019-10-31%'
  • Related