left-join-fix
This commit is contained in:
parent
870d5b62dc
commit
83204d1dff
|
@ -119,6 +119,7 @@ def get_author_comments_stat(author_id: int):
|
||||||
select(
|
select(
|
||||||
Author.id, func.coalesce(func.count(Reaction.id)).label("comments_count")
|
Author.id, func.coalesce(func.count(Reaction.id)).label("comments_count")
|
||||||
)
|
)
|
||||||
|
.select_from(Author) # явно указываем левый элемент join'а
|
||||||
.outerjoin(
|
.outerjoin(
|
||||||
Reaction,
|
Reaction,
|
||||||
and_(
|
and_(
|
||||||
|
|
Loading…
Reference in New Issue
Block a user