Closed niceIrene closed 1 year ago
GProM does not support exactly the same syntax as postgres. It does not support EXTRACT(x FROM y)
.
You can use the date_part
function in Postgres instead ... date_part('YEAR', '2019-01-01'::date);
Thank you so much! the data_part function works.
Hi, I am currently running GProM with TPC-H queries, I noticed queries that include an extract clause would cause a parser error. For example, consider the following query: select extract(year from o_orderdate) as o_year from orders limit 1;
When I execute it using backend dbms, no error occurs: \b select extract(year from o_orderdate) as o_year from orders limit 1;
However, when I run: select extract(year from o_orderdate) as o_year from orders limit 1;
It gave a parser error as follows:
Error occured (./oracle_parser.l:310) syntax error, unexpected FROM, expecting ')' or ',' at from
ABORT BASED ON EXCEPTION wipe
May I know how I should rewrite such queries to avoid that parser error? Thanks a lot!