Home > database >  Can I create a VIEW with duplicated columns?
Can I create a VIEW with duplicated columns?

Time:06-04

I'm trying to get an exact replica out of a table. But there has to be a column that will be duplicated and renamed.

My SQL statement looks like this:

CREATE VIEW VIEWNAME AS SELECT ID, ID AS "ID2" FROM TABLENAME

Is it possible to do so?

CodePudding user response:

In a word - yes, it is. As long as the resulting column names in the view aren't duplicated, there shouldn't be any problem.

  • Related