I have a script in oracle where I need to be able to reuse the value of a pseudo column that was calculated earlier in the same select clause, for example:
select 'output1' process, process || '-Output2' from Table1
I do not want to repeat the logic of the first columns again in the second column for maintenance purposes, currently this is done as
select 'output1' process, 'output1' || '-Output2' name from Table1
since I have 4 such columns that depend on the previous output of the column, repetition will be a maintenance nightmare
Edit: I included the table name and deleted the double, so no assumptions that this is not a complicated process, my actual statement has 2 to 3 joins in different tables
source share