Michael helped me with a few similar threads recently.

One of them is here:

https://groups.google.com/forum/#!topic/sqlalchemy/Vw1iBXSLibI

That uses a "last 5" correlated subquery, but you could modify that to be 
max-1 and uselist=false

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sqlalchemy+unsubscr...@googlegroups.com.
To post to this group, send email to sqlalchemy@googlegroups.com.
Visit this group at https://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.

Reply via email to