Skip to content

Conversation

@hrach
Copy link
Member

@hrach hrach commented Mar 2, 2021

No description provided.

@hrach hrach force-pushed the complex_having_where_aggregation_condition branch from 75f2742 to 67fac62 Compare March 2, 2021 21:10
@hrach hrach linked an issue Mar 2, 2021 that may be closed by this pull request
…se and aggretaion in HAVING

This commit changes how we handle has-many relationship query construciton.
Until now, every has-many relationship was simply left-joined and filtered
via where. The duplication was solved by group-by statement.

From now on, the joined table is filtered already in the JOIN clause and the
where-part is simply aggretation count of the joined table > 0.

This allow moving the where clause to having clause, where it may be
combined with other aggregation filtering condition.
@hrach hrach force-pushed the complex_having_where_aggregation_condition branch from 67fac62 to d52f0c1 Compare March 2, 2021 21:24
@hrach hrach merged commit 880b998 into master Mar 26, 2021
@hrach hrach deleted the complex_having_where_aggregation_condition branch March 26, 2021 22:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Complex HAVING & WHERE queries

2 participants