Imagine that you need sort records by lowest value of either one of two columns.
Some databases could use a non-aggregated MIN() or LEAST() function for this (... ORDER BY MIN(Date1, Date2)), but in standard SQL, you have to use a CASE expression.
The CASE expression in the query below looks at th...