-1

In my database, i have a column "refused", she can have 0 or 1 or NULL value.

I want to get only rows with 0 and NULL values.

I tried this :

->andWhere('b.refused IS NULL')

It's okay, but if i want to get the 0 values too that's not working :

->andWhere('b.refused = 0')

Anyone know how do this or how to don't get any rows where there is "1" ?

Thank you.

Tony S
  • 491
  • 6
  • 26

1 Answers1

0

You have to only get 0 OR NULL values, or your could get all elements not equals to 1 so do :

->where($qb->expr()->isNull('b.refused'));
->orWhere('b.refused = 0')
Dylan KAS
  • 4,840
  • 2
  • 15
  • 33