I would like to write a query that returns a single date value, that value being whichever of two columns is the most recent.
So if I have a table with values a, b, date1, date2 I want something like:
SELECT a, b, (Greater of date1 and date2) as date FROM...
Is this possible?
You can use the GREATEST function .