Created
May 21, 2019 22:20
-
-
Save get-data-/8cef6aa1bbc23070ffeecbca3a023ab4 to your computer and use it in GitHub Desktop.
SQLAlchemy Return All Distinct Column Values
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Class.query.with_entities(Class.title).distinct() | |
titles = [r.title for r in session.query(Class.title).distinct()] | |
source:https://stackoverflow.com/questions/22275412/sqlalchemy-return-all-distinct-column-values |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment