Re: join problem

From: Ales Vojacek <alesv(at)fbl(dot)cz>
To:
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: join problem
Date: 2007-06-13 13:47:36
Message-ID: 466FF578.5040507@fbl.cz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

There is not referenced table cai in from clausule.

A. R. Van Hook napsal(a):
> I have join problem:
> "select i.ivid, v.eventdate, v.deposit, v.invdate, cai.db,
> sum(i.tax) as tax,
> sum(i.tax + i.rowtot) as totalP,
> (sum(i.tax + i.rowtot) - v.deposit) as balance
> from invoice v
> left outer join
> invoiceitems i
> on v.ivid = i.ivid
> where v.cusid = $cusid
> and v.cusid = cai.cusid group by
> i.ivid, v.eventdate, v.deposit, v.invdate, cai.db
> ERROR: missing FROM-clause entry for table "cai"
>
> If I add cai to the from clause "from invoice v, cai, I get
> ERROR: missing FROM-clause entry for table "cai"
> ERROR: invalid reference to FROM-clause entry for table "v"
>
> Where do I add the cai table reference???
>
> thanks
>

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Ales Vojacek 2007-06-13 13:52:57 Re: join problem
Previous Message Guillaume Lelarge 2007-06-13 13:44:40 Re: join problem