Showing results for 
Search instead for 
Did you mean: 

Duplicate column headers hana

0 Kudos

On trying to create the view, I am getting error 'duplicate column name: PXX_ID'. I cannot do an inner join as most of the data in the 2 columns I am joining on don't match and I still need all of the data. Now, I understand this can be avoided by putting aliases for the column but that would make my situation difficult as I have almost 100 tables to be put into the view out of which some will have multiple matching columns and I am already using dynamic SQL to make it work

Is there any other way I can retain all columns from both tables and still save it in the view?

Accepted Solutions (0)

Answers (2)

Answers (2)

Active Contributor
0 Kudos

This question is only part of the problem. The OPs other question gives more insight into what should be done.

I answered that in more detail, so here is just the link to it.

0 Kudos

the column is coming from the result of table A and also table B. Both are

Virtual tables where a ‘*’ is being used. To get around this you will need to list out all columns from A or B and rename one of the PXX_ID columns.

For instance:
select PXX_ID as PXXX_ID from E_STG;