0

I've got a little issue. I've got to do a query that is based on a subquery. The SQL query I need to get to is:

FROM testing t
WHERE t.id NOT IN (
    SELECT h.task_id
    FROM task t
    INNER JOIN hardware h ON h.task_id = t.id
          );

What I have for a moment is the basic query and I don't really understand how to do that subquery..

$test->createQueryBuilder('t')
            ->select('t.id')
            ->getQuery()->getArrayResult();
Stefan DOK
  • 61
  • 5
  • I would try it with createNativeQuery https://www.doctrine-project.org/projects/doctrine-orm/en/2.9/reference/native-sql.html – Tim Zwinkels Aug 19 '21 at 10:39
  • You could check questions like https://stackoverflow.com/questions/60177086/getting-error-on-not-in-subquery-in-doctrine-symfony-4 for helping you – sdespont Aug 20 '21 at 20:11

0 Answers0