I am querying a table named artists, but I would like to sort the response based on a table named paintings (an artist has_many paintings – the painting table has an artist_id column).
To be more specific, I want to sort the artists by their most recent painting (paintings have a column named date_created). Does anyone know how this could be done?
Ideally this should be done using ANSI joins: