I have a mysql table which have datetime stored as string. I want to get the rows from the table with the time range provided.
My table looks like:
datetime plugin_name
2017-11-12T00:44:48.530000 testng
2017-11-12T00:44:48.529000 testng
2017-11-12T00:46:22.668000 testng
2017-11-12T00:46:22.666000 testng
2017-11-12T01:00:16.338000 ntf-test
Here column datetime
has type as String
.I have tried with this query
select `datetime`, plugin_name
from plugin_names
where datetime(`datetime`) > '2017-06-29T06:16:49.426000'
and DATETIME(`datetime`) < '2017-06-29T06:16:49.314000'
But I am getting error as:
Encountered: DATETIME
Expected: CASE, CAST, DEFAULT, EXISTS, FALSE, IF, INTERVAL, NOT, NULL, REPLACE, TRUNCATE, TRUE, IDENTIFIER
I tried following this: MySQL compare DATE string with string from DATETIME field
I am using Impala for distributed Mysql database Anyone has idea how to fix this?