Re: join problem
От
Guillaume Lelarge
Тема
Re: join problem
Дата
Msg-id
466FF4C8.3010006@lelarge.info
Ответ на
join problem (A. R. Van Hook)
Список
Дерево обсуждения
join problem "A. R. Van Hook" <hook@lake-lotawana.mo.us>
Re: join problem Guillaume Lelarge <guillaume@lelarge.info>
Re: join problem Ales Vojacek <alesv@fbl.cz>
Re: join problem Ales Vojacek <alesv@fbl.cz>
Re: join problem Michael Glaesemann <grzm@seespotcode.net>
A. R. Van Hook a écrit : > 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??? > You probably need to change the order of the tables in the FROM clause. Replace FROM invoice v, cai with FROM cai, invoice v Regards. -- Guillaume.
В списке pgsql-sql по дате отправления