Filter By the two or more columns inside the same Relationship #634
Unanswered
ahmedsayedabdelsalam
asked this question in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I've this simple relationship (user) has many (posts)
and this is my posts table in DB

when i filter the users by

posts.titleandposts.is_publishedhere is the query
the returned result set is not correct

here is the result
which is wrong the user has two posts one
is publishedbut the name is not equaloneand the other one name is correct equalsonebutis not publishedhere is the executed query
this issue here is that 2 separate
where existsare executed and it is correct the same user has one or more postspublishedand one ore more records with nameonenot as expected one exists clause with the the 2 conditions inside it
what i am trying to say here is there anyway or future plan for this situation ?
something like grouping the nested filter first then running one exists for each relation.
Thanks in advance.
Beta Was this translation helpful? Give feedback.
All reactions