postgresql – case when to get the max timestamp between two columns
I want to return the max updated_date timestamp. I have this code: select case when max(t1.updated_date) > max(t2.updated_date) then t1.updated_date else t2.updated_date end as MaxDate from table1 t1 inner join table2 t2 on t1.id = t2.id where t1.id = ‘5’ group by