0

I am using Exasol DB and to perform date operation, I am using SQL INTERVAL keyword with precision.

For example this query:

SELECT email_staging.ID, email_staging.CREATED_AT from EMAIL email_staging  
WHERE email_staging.CREATED_AT > (CURRENT_DATE - (INTERVAL '5' DAY(3) ) ) )

Exasol requires the precision to sent i.e. suffix like '(3)' after DAY or else it won't allow querying for more that 99 days. But H2 Database doesn't support INTERVAL with precision.

Has anyone solved this as my integration tests which use H2 DB can't run.

saurabh.in
  • 389
  • 3
  • 13
  • By the until we there is a better solution, I have switched to using TO_DATE function instead which is more consistently accepted in DB solutions. E.g. SELECT email_staging.ID, email_staging.CREATED_AT from EMAIL email_staging WHERE email_staging.CREATED_AT > TO_DATE('2022-03-06', 'YYYY-MM-DD') – saurabh.in Mar 11 '22 at 12:55

1 Answers1

0

Standard interval literals with leading field precision and/or fractional seconds precision are supported by H2 since the version 2.1.212.

Evgenij Ryazanov
  • 6,960
  • 2
  • 10
  • 18