Let t be an Oracle 11g table with columns a, b. The b column is later renamed to c.
How to develop an SQL query which works against both database versions? "Works" means:
- returns columns
a,c - behaves as
select a, c from ton new version - behaves as
select a, b as c from ton old version
The background is, the module with SQL query (it is actually based on Pentaho Data Integration) has deployment lifecycle which does not strictly match the deployment lifecycle of database changes. Also there seems to be no clean way of feature-flagging multiple versions of SQL query. Hence one-SQL-fits-all solution seems to be the simplest one for 100% compatibility.