Chrome Extension

SQLAlchemy query to get distinct records from table

To get unique records from one pr multiple columns you can use .distinct() method of SQLAlchemy
db.session.query(
    UserModel.city
).distinct().all()
Best JSON Validator, JSON Tree Viewer, JSON Beautifier at same place. Check how cool is the tool

The query will return the unique values in city column.

Was this helpful?
0 Comments