Hello everyone!

We have been investing plenty of personal time and energy for many years to share our knowledge with you all. However, we now need your help to keep this blog running. All you have to do is just click one of the adverts on the site, otherwise it will sadly be taken down due to hosting etc. costs. Thank you.

We have two options for where not in clause.


Example 1


....
  ->createQuery('e')
  ->whereNotIn('e.id', [1, 2, 3 .....]))
  ->
.....;

Example 2


$qb = $this->createQueryBuilder('e');

$qp
->select('e')
->where($qb->expr()->notIn('e.id', [1, 2, 3 .....]))
->getQuery()
->getResult();