Oracle rename columns from select automatically?

后端 未结 4 719
无人共我
无人共我 2021-01-19 14:55

I have 2 tables with the following fields.

Table1

  • AA
  • BB
  • CC
  • DD

Table2

  • AA
  • CC
4条回答
  •  情话喂你
    2021-01-19 15:37

    Is there a magic way to do this in oracle?

    Not that I'm aware of. Your options amount to:

    1. Address the column naming scheme - you'd need to use ALTER TABLE statements like:

      ALTER TABLE table_name
           RENAME COLUMN old_name to new_name;
      
    2. Use column aliases

    You could use views to save on the work & effort of defining column aliases, but it's not a recommended practice because of the bad performance when layering views on top of one another.

提交回复
热议问题