i tried to write a named query in my Entity Java Bean
class , and tried also to write the same query as a native query , its job is to delete records which difference between their timestamp column and current time stamp, are greater than 2 hours.
my query :
DELETE FROM APP.WEATHER WHERE timestampdiff(SQL_TSI_HOUR,APP.WEATHER.SINCE,CURRENT_TIMESTAMP) > 2;
but it failed , and this error message appeared to me :
Error code -1, SQL state 42X04: Column 'SQL_TSI_HOUR' is either not in any table in the FROM list or appears within a join specification and is outside the scope of the join specification or appears in a HAVING clause and is not in the GROUP BY list. If this is a CREATE or ALTER TABLE statement then 'SQL_TSI_HOUR' is not a column in the target table.
Line 1, column 1