Use raw query as subquery for IN statement. #9792
Unanswered
nyatMeat
asked this question in
Support Questions
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.
-
Hi guys!
Here is the problem, I have main query which is written with DoctrineQueryBuilder and I need to rewrite one filter to force query working with indexes in database.
Select userId from user_emails where domain = 'domain' union select userId from user_emails_history where domain = 'domain'
Here the query for the filter.
I've tried to get all id and put them into main query but for some cases I get millions of records.
Need to inject this sql to the main query like that
$users = $this->createQueryBuilder()->where('id in $query');
How can I do that with Query builder? (Not DBAL builder)
Beta Was this translation helpful? Give feedback.
All reactions