Skip to content

How to convert query(exists()...) to SQLAlchemy 2 syntax? #9404

Answered by zzzeek
mcarans asked this question in Usage Questions
Discussion options

You must be logged in to vote

you want to put the exists() inside of a select()

 stmt = select(exists().where(and_(...)))

run that

result = session.scalar(stmt)

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@aalvrz
Comment options

@CaselIT
Comment options

Answer selected by mcarans
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
4 participants