I have an entity with a date
property represented as a String
(I can't change it to Date or Timestamp).I need to get all newest records (not older than an hour).
I have a SQL query that returns the last (youngest) record, now I need to substract an hour from it somehow:
SELECT p FROM Invoice p WHERE date >= ((SELECT MAX(date) FROM Invoice)
it's Java and Posgresql. Can this be done using SQL when date is represented as a String?