I am a Student working on a project useing mysql. I am trying to set up a view and keep getting an error that there is duplicate columns. Is there anyway other then specifiying each table.culumn to stop the view from trying to show both of the columns. If it helps the two columns are the primary key of one table and the foreign key of another.

Recommended Answers

All 3 Replies

If you are using "select * " then change the query, you must specifically select the columns you want in your view from various tables. If still two columns from diffrerent table has same name then give alias to one of them.

If you are using "select * " then change the query, you must specifically select the columns you want in your view from various tables. If still two columns from diffrerent table has same name then give alias to one of them.

Is there any way to just drop the foreign key instead of useing alias (will still show which will dock points)

You may simply ignore foriegn keys in select statment. and still you will be able to use them in where or join condition.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.