Skip to content
Advertisement

How to union two counts queries in SQLAlchemy?

I have two queries and the only difference between then is that one is counting the success status and the other failure status. Is there a way to get this result in just one query? I’m using SQLALchemy to do the queries.

Advertisement

Answer

You can use conditions on Count, your query will look like:

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