Re: Duplicate column (libellecommune) exists in view.
Posted in 1998
Eric Bacher wrote:
>
> I have an unexpected behavior when using Informix SQL. I try to create a
> view where I make a join between 2 tables with the same column name. In
> the Select, I use an alias to distinguish these 2 columns. However, when
> creating the view, I have the following error:
>
> 531: Duplicate column (libellecommune) exists in view.>
> here is the create command:
>
> create view localisation as
> select bibliotheque.numeronotice,
> phy.libellecommune,
> com.libellecommune
> from bibliotheque,
> outer commune phy,
> outer commune com
> where bibliotheque.numeroinsee = phy.numeroinsee
> and bibliotheque.numeroinseecom = com.numeroinsee>
It appears that there no alias has been created. Try this:
create view localisation as
select bibliotheque.numeronotice,
phy.libellecommune libel1,
com.libellecommune libel2
from bibliotheque,
outer commune phy,
outer commune com
where bibliotheque.numeroinsee = phy.numeroinsee
and bibliotheque.numeroinseecom = com.numeroinsee
Then use libel1 and/or libel2 in the select on the view.
John Carlson
Informix DBA
WH Smith, Inc.