I am using Oracle and trying to create a view in which I will replace one date value with another date value. I am trying to use case when
statement, however, I need to use the same column name as an alias and I get the error that I have duplicate column names. Do you know how to fix it or propose the alternative for replacing date value in a column and creating view? I need to keep the original table unchanged.
Code:
create view name_of_view as
select t.*,
(case when birth_date = to_date('4.12.2015', 'DD.MM.YYYY')
then to_date('4.12.1950', 'DD.MM.YYYY')
else birth_date end) as birth_date
from table t;