Re: conditional return of data in SELECT
Something like this?
select
t1.name name
, case
when t2.town_name is not null then t2.town_name
else t1.town
end town
from table1 t1
left join table2 t2
on t1.town = t2.town_actual
+------+-----------+
| name | town |
+------+-----------+
| Ed | Boston |
| Mike | Newton |
| Dave | Malden |
| Erin | Haverhill |
+------+-----------+
Regards, Phill W.
Subject
Written By
Posted
Re: conditional return of data in SELECT
January 26, 2021 04:52AM
February 01, 2021 05:27AM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.