Thread: subquery involving 'now'

subquery involving 'now'

From
jmycr@cs.com
Date:
SELECT a.backup_id, a.archive_id, a.file_name, a.file_size, b.something
FROM archive a, burp b
WHERE a.aname = b.aname and a.backup_date < 'now'::datetime - '(select maxday_savefile from service) days'::timespan;

this does not work, any suggestions
jnc


Re: subquery involving 'now'

From
"Gaetano Mendola"
Date:
<jmycr@cs.com> wrote:
> SELECT a.backup_id, a.archive_id, a.file_name, a.file_size, b.something
> FROM archive a, burp b
> WHERE a.aname = b.aname and a.backup_date < 'now'::datetime - '(select
maxday_savefile from service) days'::timespan;

Try:

using now() not 'now'::datetime.


Ciao.



Re: subquery involving 'now'

From
Stephan Szabo
Date:
On Thu, 7 Mar 2002 jmycr@cs.com wrote:

> SELECT a.backup_id, a.archive_id, a.file_name, a.file_size, b.something
> FROM archive a, burp b
> WHERE a.aname = b.aname and a.backup_date < 'now'::datetime - '(select maxday_savefile from service)
days'::timespan;
>
> this does not work, any suggestions

Maybe
- ((select maxday_savefile from service) || ' days')::timespan