Sql Latest Date Function Postgresql Tutorial Subquery Question