سؤال

Have a named query written like this

select u from User u where u.creationdate < DATE_SUB(CURDATE(),INTERVAL :upperDate DAY) and status=:status and reminder_counter =:counter

But I get a Syntax error parsing.

Any ideas`?

P

هل كانت مفيدة؟

المحلول

The function DATE_SUB you are using is MySQL specific, resulting in parsing error.

  • Create a named native query to use DATE_SUB function.
  • Else, can calculate the duration explicitly & then setting the parameter.
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top