Chrome Extension

Get first record Sqlalchemy

Get the very first record from a model or table using the Sqlalchemy query.
#Get vey first record from a table which has id grater than 10
session.query(User).filter(User.id > 10).first()
Code faster with devsheet chrome extension and increase productivity as a programmer
search code from your favorite search engine instantly.
Install Now

You can get the very first record from a table using the Sqlalchemy query using the .first() method.

Was this helpful?
0 Comments
Open Code Manager We are hiring