I get this error
Bad interval external representation '(select maxday_savefile from backup) days'
Does anybody know of a way to use now() subtracting the result of a subquery?
I am trying to get values of a file saved that has overstayed its visit on my system.
The query itself looks good, but...
SELECT b.backup_id, a.file_name, a.file_size
FROM archive a, backup b
WHERE a.bkup_name = b.bkup_name and a.backup_date < 'now'::datetime - '(SELECT maxday_savefile
FROM backup) days'::timespan;
Bad interval external representation '(select maxday_savefile from backup) days'
Does anybody know of a way to use now() subtracting the result of a subquery?
I am trying to get values of a file saved that has overstayed its visit on my system.
The query itself looks good, but...
SELECT b.backup_id, a.file_name, a.file_size
FROM archive a, backup b
WHERE a.bkup_name = b.bkup_name and a.backup_date < 'now'::datetime - '(SELECT maxday_savefile
FROM backup) days'::timespan;