Skip to content
Advertisement

SqlAlchemy: How to use the result of a selected subquery inside the where clause

I wish to get a list of articles along with the count of the comments for each article

My query looks like this –

it gives this error

How can I use the count which I selected to filter the result?

Advertisement

Answer

This works, but is it the most optimal query?

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