I have two tables Security and CallPut. Security (table1) contain security_id and maturity_date (non noll values) and CallPut(table2) which has security_id and Odate (which are non null values which contains date time format values) I want to select all rows from security(table 1) but in maturity_date i want value from odate column instead of maturity_date where security id exists in Callput(table2) and matches with security table
Eg Security(table1)
Security_id|Maturity_date
abcd 25Jan2020
bcde 25jan2021
Callput(tabble2)
Security_id|Odate
abcd 25Jan2015
Required Output
Security_id|Maturity_date
abcd 25Jan2015 (since here id is there in callput it takes odate)
bcde 25jan2021 (since here id is not there in callput it takes maturity date)
I use oracle sql Please help . Thanks in advance