pg.ddx.io pgsql-sql@postgresql.org mailing list archive
help / color / mirror / Atom feedgone blind - can't see syntax error
5+ messages / 4 participants
[nested] [flat]
* gone blind - can't see syntax error
@ 2005-04-01 11:36 Gary Stainburn <gary.stainburn@ringways.co.uk>
0 siblings, 3 replies; 5+ messages in thread
From: Gary Stainburn @ 2005-04-01 11:36 UTC (permalink / raw)
To: pgsql-sql
Hi folks.
I've been looking at this for 10 minutes and can't see what's wrong.
Anyone care to enlighten me.
Thanks
Gary
[httpd@stan webroot]# psql -a -f new-view.sql
SELECT r.r_id, r.r_registration, r.r_chassis, r.r_vehicle, r.r_fuel,
r.r_pack_mats, r.r_delivery,
(date(r.r_delivery) - date(now())) AS r_remaining, r.r_created,
r.r_completed, r.r_salesman,
sm.r_salesman as salesman_name,
d.d_des, de.de_des,
u.u_id, u.u_userid, u.u_username, u.u_salesman, u.u_target,
t.t_id, t.t_des,
s.s_id, s.s_des,
c.c_id, c.c_des,
co.com_count, co.com_unseen
FROM requests r,
left outer join users sm on sm.u_id = r.r_salesman,
left outer join users u on r.r_u_id = u.u_id,
left outer join request_types t on r.r_t_id = t.t_id,
left outer join request_states s on r.r_s_id = s.s_id,
left outer join dealerships d on r.r_d_id = d.d_id,
left outer join departments de on r.r_de_id = de.de_id,
left outer join customers c on r.r_c_id = c.c_id,
left outer join comment_tallies co on r.r_id = co.r_id
ORDER BY r.r_id;
psql:new-view.sql:19: ERROR: parser: parse error at or near "left"
--
Gary Stainburn
This email does not contain private or confidential material as it
may be snooped on by interested government parties for unknown
and undisclosed purposes - Regulation of Investigatory Powers Act, 2000
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: gone blind - can't see syntax error
@ 2005-04-01 11:51 Dinesh Pandey <dpandey@secf.com>
parent: Gary Stainburn <gary.stainburn@ringways.co.uk>
2 siblings, 0 replies; 5+ messages in thread
From: Dinesh Pandey @ 2005-04-01 11:51 UTC (permalink / raw)
To: 'Gary Stainburn' <gary.stainburn@ringways.co.uk>; pgsql-sql
Try this
FROM requests r
left outer join users sm on sm.u_id = r.r_salesman
left outer join users u on r.r_u_id = u.u_id
left outer join request_types t on r.r_t_id = t.t_id
left outer join request_states s on r.r_s_id = s.s_id
left outer join dealerships d on r.r_d_id = d.d_id
left outer join departments de on r.r_de_id = de.de_id
left outer join customers c on r.r_c_id = c.c_id
left outer join comment_tallies co on r.r_id = co.r_id ORDER BY r.r_id;
-----Original Message-----
From: pgsql-sql-owner@postgresql.org [mailto:pgsql-sql-owner@postgresql.org]
On Behalf Of Gary Stainburn
Sent: Friday, April 01, 2005 5:06 PM
To: pgsql-sql@postgresql.org
Subject: [SQL] gone blind - can't see syntax error
Hi folks.
I've been looking at this for 10 minutes and can't see what's wrong.
Anyone care to enlighten me.
Thanks
Gary
[httpd@stan webroot]# psql -a -f new-view.sql SELECT r.r_id,
r.r_registration, r.r_chassis, r.r_vehicle, r.r_fuel, r.r_pack_mats,
r.r_delivery,
(date(r.r_delivery) - date(now())) AS r_remaining, r.r_created,
r.r_completed, r.r_salesman,
sm.r_salesman as salesman_name,
d.d_des, de.de_des,
u.u_id, u.u_userid, u.u_username, u.u_salesman, u.u_target,
t.t_id, t.t_des,
s.s_id, s.s_des,
c.c_id, c.c_des,
co.com_count, co.com_unseen
FROM requests r,
left outer join users sm on sm.u_id = r.r_salesman, left outer join users u
on r.r_u_id = u.u_id, left outer join request_types t on r.r_t_id = t.t_id,
left outer join request_states s on r.r_s_id = s.s_id, left outer join
dealerships d on r.r_d_id = d.d_id, left outer join departments de on
r.r_de_id = de.de_id, left outer join customers c on r.r_c_id = c.c_id, left
outer join comment_tallies co on r.r_id = co.r_id ORDER BY r.r_id;
psql:new-view.sql:19: ERROR: parser: parse error at or near "left"
--
Gary Stainburn
This email does not contain private or confidential material as it may be
snooped on by interested government parties for unknown
and undisclosed purposes - Regulation of Investigatory Powers Act, 2000
---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: gone blind - can't see syntax error
@ 2005-04-01 11:55 Mike Rylander <mrylander@gmail.com>
parent: Gary Stainburn <gary.stainburn@ringways.co.uk>
2 siblings, 0 replies; 5+ messages in thread
From: Mike Rylander @ 2005-04-01 11:55 UTC (permalink / raw)
To: Gary Stainburn <gary.stainburn@ringways.co.uk>; +Cc: pgsql-sql
On Apr 1, 2005 11:36 AM, Gary Stainburn <gary.stainburn@ringways.co.uk> wrote:
> Hi folks.
>
> I've been looking at this for 10 minutes and can't see what's wrong.
> Anyone care to enlighten me.
>
> Thanks
>
> Gary
>
> [httpd@stan webroot]# psql -a -f new-view.sql
> SELECT r.r_id, r.r_registration, r.r_chassis, r.r_vehicle, r.r_fuel,
> r.r_pack_mats, r.r_delivery,
> (date(r.r_delivery) - date(now())) AS r_remaining, r.r_created,
> r.r_completed, r.r_salesman,
> sm.r_salesman as salesman_name,
> d.d_des, de.de_des,
> u.u_id, u.u_userid, u.u_username, u.u_salesman, u.u_target,
> t.t_id, t.t_des,
> s.s_id, s.s_des,
> c.c_id, c.c_des,
> co.com_count, co.com_unseen
> FROM requests r,
^^^
> left outer join users sm on sm.u_id = r.r_salesman,
> left outer join users u on r.r_u_id = u.u_id,
> left outer join request_types t on r.r_t_id = t.t_id,
> left outer join request_states s on r.r_s_id = s.s_id,
> left outer join dealerships d on r.r_d_id = d.d_id,
> left outer join departments de on r.r_de_id = de.de_id,
> left outer join customers c on r.r_c_id = c.c_id,
> left outer join comment_tallies co on r.r_id = co.r_id
> ORDER BY r.r_id;
> psql:new-view.sql:19: ERROR: parser: parse error at or near "left"
Don't put commas between your joins.
--
Mike Rylander
mrylander@gmail.com
GPLS -- PINES Development
Database Developer
http://open-ils.org
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: gone blind - can't see syntax error
@ 2005-04-01 12:01 Kenneth Gonsalves <lawgon@thenilgiris.com>
parent: Gary Stainburn <gary.stainburn@ringways.co.uk>
2 siblings, 1 reply; 5+ messages in thread
From: Kenneth Gonsalves @ 2005-04-01 12:01 UTC (permalink / raw)
To: Gary Stainburn <gary.stainburn@ringways.co.uk>; +Cc: pgsql-sql
On Friday 01 Apr 2005 5:06 pm, Gary Stainburn wrote:
> Hi folks.
>
> I've been looking at this for 10 minutes and can't see what's
> wrong. Anyone care to enlighten me.
comma after 'r'?
--
regards
kg
http://www.livejournal.com/users/lawgon
tally ho! http://avsap.sourceforge.net
ಇಂಡ್ಲಿನಕ್ಸ வாழ்க!
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: gone blind - can't see syntax error
@ 2005-04-01 12:08 Gary Stainburn <gary.stainburn@ringways.co.uk>
parent: Kenneth Gonsalves <lawgon@thenilgiris.com>
0 siblings, 0 replies; 5+ messages in thread
From: Gary Stainburn @ 2005-04-01 12:08 UTC (permalink / raw)
To: pgsql-sql
On Friday 01 April 2005 1:01 pm, you wrote:
> On Friday 01 Apr 2005 5:06 pm, Gary Stainburn wrote:
> > Hi folks.
> >
> > I've been looking at this for 10 minutes and can't see what's
> > wrong. Anyone care to enlighten me.
>
> comma after 'r'?
I'd only just added that comma, to try to fix it. That shouldn't have
been there.
The problem was the comma after each of the joins. They should not have
been there either.
Gary
--
Gary Stainburn
This email does not contain private or confidential material as it
may be snooped on by interested government parties for unknown
and undisclosed purposes - Regulation of Investigatory Powers Act, 2000
^ permalink raw reply [nested|flat] 5+ messages in thread
end of thread, other threads:[~2005-04-01 12:08 UTC | newest]
Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2005-04-01 11:36 gone blind - can't see syntax error Gary Stainburn <gary.stainburn@ringways.co.uk>
2005-04-01 11:51 ` Dinesh Pandey <dpandey@secf.com>
2005-04-01 11:55 ` Mike Rylander <mrylander@gmail.com>
2005-04-01 12:01 ` Kenneth Gonsalves <lawgon@thenilgiris.com>
2005-04-01 12:08 ` Gary Stainburn <gary.stainburn@ringways.co.uk>
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