MySQL Forums
Forum List  »  Oracle

Error Code: 1060 Duplicate column name 'id_usuario'
Posted by: jose luis sanchez ortiz
Date: July 08, 2015 09:02PM

Hi Friends.Help me.I got an error when creating a view

create table usuario(
id_usuario int primary key auto_increment,
nombre varchar(100) not null
)engine=innodb;

create table afiliacion(
id_afiliacion int primary key auto_increment,
id_padre int not null,
id_hijo int not null,
foreign key(id_padre) references usuario(id_usuario),
foreign key(id_hijo) references usuario(id_usuario)
)engine=innodb;

CREATE VIEW usuafi_view AS SELECT *
FROM afiliacion
INNER JOIN usuario AS p ON p.id_usuario=afiliacion.id_padre
INNER JOIN usuario AS h ON h.id_usuario=afiliacion.id_hijo;

ERROR 1060 (42S21): Duplicate column name 'id_usuario'

Thanks in advance

Options: ReplyQuote


Subject
Views
Written By
Posted
Error Code: 1060 Duplicate column name 'id_usuario'
5883
July 08, 2015 09:02PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.