[Zope] duplicate column name

Olaf Zanger olaf.zanger@soli-con.com
Thu, 07 Dec 2000 15:19:48 +0100


Dies ist eine mehrteilige Nachricht im MIME-Format.
--------------24915070AC08C4849BF1BFBD
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit



Ivan Cornell schrieb:
> 
> Olaf Zanger wrote:
> 
> > i work with postgreSQL 7.0.2, ZPyGreSQLDA-0-0-3 and zope 2.2.2 on suse
> > 7.0 linux
> >
> > when i try the line
> >
> > -> select adr.id,fac.id from fac, adr
> >
> 
> You probably need to alias the columns:
> select adr.id as adr_id, fac.id as fac_id from fac, adr
> and then refer to adr_id & fac_id from zope.
> 
> [can't remember why, but think it is due to the way columns are addressed
> in libpq]

thanks, 
worked out fine, gets a bit tricky though :-)
as visible further down it is not needed in "where" and "order by"
clauses *ç%&?!

select
fac.id as fac_id,
adr.id as adr_id,
fac.name as fac_name,
adr.id as adr_id,
owner_adr_id,

from
fac,adr

where
fac.name like '%'
and adr.id=owner_adr_id
and fac.mod_id=mod.id

order by
fac.name

-- 
soli-con Engineering Zanger
Dipl.-Ing. (FH) Olaf Zanger Nusch
Lorrainestrasse 23
3013 Bern / Switzerland
Fon: +41-31-332 9782
Mob: +41-76-572 9782
mailto:info@soli-con.com
mailto:olaf.zanger@soli-con.com
http://www.soli-con.com
--------------24915070AC08C4849BF1BFBD
Content-Type: text/x-vcard; charset=us-ascii;
 name="olaf.zanger.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Visitenkarte für Olaf Zanger
Content-Disposition: attachment;
 filename="olaf.zanger.vcf"

begin:vcard 
n:Zanger;Olaf Marc
tel;cell:+41-76-572 9782
tel;work:+41-31-332 9782
x-mozilla-html:FALSE
url:www.soli-con.com
org:soli-con Engineering Zanger
adr:;;Lorrainestrasse 23;Bern;BE;3013;Switzerland
version:2.1
email;internet:olaf.zanger@soli-con.com
title:Dipl.-Ing.
note;quoted-printable:IT-Consulting=0D=0AEmbedded Systems=0D=0AEnergy Systems=0D=0AOpen Source Solutions=0D=0A
x-mozilla-cpt:;-32176
fn:Olaf Zanger
end:vcard

--------------24915070AC08C4849BF1BFBD--