Re: Problem with complex outer join expression

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Chris Velevitch" <chris(dot)velevitch(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Problem with complex outer join expression
Date: 2006-04-26 16:28:44
Message-ID: 18375.1146068924@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"Chris Velevitch" <chris(dot)velevitch(at)gmail(dot)com> writes:
> select dummy_records.sequence_nr,timesheets.weekending,timesheets.timesheet_id
> from dummy_records
> ,left outer join timesheets
> on (timesheets.weekending = ('2006-04-09' + (integer
> dummy_records.sequence_nr-1)*7)))
> where dummy_records.sequence_nr between 1 and (date '2006-04-23' -
> date '2006-04-09')/7+1;

> ERROR: syntax error at or near "(" at character 155

> What am I doing wrong here?

The comma before LEFT OUTER JOIN is incorrect, and the keyword "integer"
is being used inappropriately. I think you've miscounted your
parentheses too.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2006-04-26 16:44:10 Re: PL/Ruby, INOUT parameters / SETOF record
Previous Message Tom Lane 2006-04-26 16:10:43 Re: Ordering of records in group by not possible