X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id A040052A7D for ; Fri, 1 Apr 2005 12:55:43 +0100 (BST) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 83072-09 for ; Fri, 1 Apr 2005 11:55:33 +0000 (GMT) Received: from rproxy.gmail.com (rproxy.gmail.com [64.233.170.193]) by svr1.postgresql.org (Postfix) with ESMTP id A855853202 for ; Fri, 1 Apr 2005 12:55:32 +0100 (BST) Received: by rproxy.gmail.com with SMTP id c51so664212rne for ; Fri, 01 Apr 2005 03:55:34 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:references; b=FLlkrL9/zu+7q+GY7rMwa+v4ACLtSvyDRgq5PoAH1SdaIVE8VfoOta4YpZFhWQtWu/qL+zZWhBIlNC2zFv6kT3dyRR+4YEe3c0PMGwRlhHT9YnMHaM1iMbNMevo/uILufTcuJHkHp4dOZ6t3xsn5X0YK9n43UmtDMosmcUEJgVE= Received: by 10.38.104.35 with SMTP id b35mr2384427rnc; Fri, 01 Apr 2005 03:55:34 -0800 (PST) Received: by 10.38.126.31 with HTTP; Fri, 1 Apr 2005 03:55:34 -0800 (PST) Message-ID: Date: Fri, 1 Apr 2005 11:55:34 +0000 From: Mike Rylander Reply-To: Mike Rylander To: Gary Stainburn Subject: Re: gone blind - can't see syntax error Cc: pgsql-sql@postgresql.org In-Reply-To: <200504011236.00974.gary.stainburn@ringways.co.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit References: <200504011236.00974.gary.stainburn@ringways.co.uk> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.249 tagged_above=0 required=5 tests=AWL, DNS_FROM_RFC_ABUSE, RCVD_BY_IP X-Spam-Level: X-Archive-Number: 200504/6 X-Sequence-Number: 20899 On Apr 1, 2005 11:36 AM, 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. > > 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