pg.ddx.io pgsql-sql@postgresql.org mailing list archive
help / color / mirror / Atom feedquery failed , don't know why
4+ messages / 4 participants
[nested] [flat]
* query failed , don't know why
@ 2000-06-23 18:53 Jeff MacDonald <jeff@pgsql.com>
2000-06-23 22:04 ` Re: query failed , don't know why Brian P. Mann <bpmann@modempool.com>
2000-06-24 03:31 ` Re: query failed , don't know why Thomas Lockhart <lockhart@alumni.caltech.edu>
2000-06-24 04:37 ` Re: [HACKERS] query failed , don't know why Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 3 replies; 4+ messages in thread
From: Jeff MacDonald @ 2000-06-23 18:53 UTC (permalink / raw)
To: pgsql-sql; pgsql-hackers@postgresql.org
UPDATE members m,payments p SET m.status = 2 WHERE p.paydate > 'now'::datetime - '1 month'::timespan and p.productid = 'xxxxxxx' and m.gid = p.gid
i'm trying to run that query and i'm getting
"parse error near m"
but it looks ok to me
i'm running postgresql 7.0.2 with freebsd 4.0 stable
jeff
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: query failed , don't know why
2000-06-23 18:53 query failed , don't know why Jeff MacDonald <jeff@pgsql.com>
@ 2000-06-23 22:04 ` Brian P. Mann <bpmann@modempool.com>
2 siblings, 0 replies; 4+ messages in thread
From: Brian P. Mann @ 2000-06-23 22:04 UTC (permalink / raw)
To: pgsql-hackers@postgresql.org
shouldn't that be m.payments and not m,payments?
Brian
----- Original Message -----
From: "Jeff MacDonald" <jeff@pgsql.com>
To: <pgsql-sql@postgresql.org>; <pgsql-hackers@postgresql.org>
Sent: Friday, June 23, 2000 2:53 PM
Subject: [HACKERS] query failed , don't know why
> UPDATE members m,payments p SET m.status = 2 WHERE p.paydate >
'now'::datetime - '1 month'::timespan and p.productid = 'xxxxxxx' and m.gid
= p.gid
>
> i'm trying to run that query and i'm getting
>
> "parse error near m"
>
> but it looks ok to me
>
> i'm running postgresql 7.0.2 with freebsd 4.0 stable
>
> jeff
>
>
>
>
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: query failed , don't know why
2000-06-23 18:53 query failed , don't know why Jeff MacDonald <jeff@pgsql.com>
@ 2000-06-24 03:31 ` Thomas Lockhart <lockhart@alumni.caltech.edu>
2 siblings, 0 replies; 4+ messages in thread
From: Thomas Lockhart @ 2000-06-24 03:31 UTC (permalink / raw)
To: Jeff MacDonald <jeff@pgsql.com>; +Cc: pgsql-sql; pgsql-hackers@postgresql.org
> UPDATE members m,payments p SET m.status = 2
> WHERE p.paydate > 'now'::datetime - '1 month'::timespan
> and p.productid = 'xxxxxxx' and m.gid = p.gid
Try
UPDATE members set status = 2
FROM payments p
WHERE p.paydate > timestamp 'now' - interval '1 month'
AND p.productid = 'xxxxxxx' and members.gid = p.gid;
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: [HACKERS] query failed , don't know why
2000-06-23 18:53 query failed , don't know why Jeff MacDonald <jeff@pgsql.com>
@ 2000-06-24 04:37 ` Tom Lane <tgl@sss.pgh.pa.us>
2 siblings, 0 replies; 4+ messages in thread
From: Tom Lane @ 2000-06-24 04:37 UTC (permalink / raw)
To: Jeff MacDonald <jeff@pgsql.com>; +Cc: pgsql-sql; pgsql-hackers@postgresql.org
Jeff MacDonald <jeff@pgsql.com> writes:
> UPDATE members m,payments p SET m.status = 2 WHERE p.paydate > 'now'::datetime - '1 month'::timespan and p.productid = 'xxxxxxx' and m.gid = p.gid
> i'm trying to run that query and i'm getting
> "parse error near m"
> but it looks ok to me
OK according to what reference? SQL92 doesn't allow anything but a
simple <table name> between UPDATE and SET --- no aliases, much less
multiple table names.
regards, tom lane
^ permalink raw reply [nested|flat] 4+ messages in thread
end of thread, other threads:[~2000-06-24 04:37 UTC | newest]
Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2000-06-23 18:53 query failed , don't know why Jeff MacDonald <jeff@pgsql.com>
2000-06-23 22:04 ` Brian P. Mann <bpmann@modempool.com>
2000-06-24 03:31 ` Thomas Lockhart <lockhart@alumni.caltech.edu>
2000-06-24 04:37 ` Tom Lane <tgl@sss.pgh.pa.us>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox