Skip to content
Advertisement

How to delete last row using SQLAlchemy?

I need to exec next query:

I trying:

My current way (I would like to get rid of the loop):

Advertisement

Answer

Since you’re dealing with ORM objects you can just retrieve the “last” item and then delete it:

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement