Q:

CASE or IF condition in WHERE clause for the below requirement

I have a below requirement but I do not know how to write a Oracle SQL query to fetch the data based on the given condition.
Requirement: 
Person table
Name       created_date   updated_date
-------    -----------    ------------
Alex       11-oct-2018     
John       10-oct-2018    11-oct-2018

I want to fetch the records name, created_date or updated_date as last_modified_date based on from and to date that were given on UI and it should search on the updated_date like updated_date between fromdate and todate if updated_date is not null. if updated_date is null then it should search on created_date like created_date between fromdate and todate. 
I tried like this, there are compilation issues, i do not how to write
select name,
       case when update_date is null then created_date else updated_date as last_modified_date 
from Person 
where case when updated_date is null 
           then trunc(created_date) between fromdate and todate 
           else trunc(updated_date) between fromdate and todate.'

A:

Something like this?
select name, nvl(update_date,created_date) as last_modified_date
from Person 
where nvl(update_date,created_date) between fromdate and todate;

A:

Using:

CASE WHEN [condition] THEN [return_expr] ELSE [else_expr] END

Select name, 
       CASE WHEN update_date IS NULL
            THEN created_date
            ELSE updated_date END AS last_modified_date
  FROM Person
 WHERE CASE WHEN updated_date IS NULL
            THEN TRUNC(created_date)
            ELSE TRUNC(updated_date) END BETWEEN fromdate AND todate;

or using for oracle only:

NVL([expr1], [expr2])

Select name, 
       NVL(update_date, created_date) AS last_modified_date
  FROM Person
 WHERE NVL(updated_date, created_date) BETWEEN fromdate AND todate;

