0

sql

WHERE code= 'abc' AND (column_name NOT IN ('436') or column_name is null)

Doctrine code

            ->innerJoin('Bundle:Web', 'p', 'WITH', 'b.pid= p.id')
            ->where('a.code= :cust_id')
            ->andWhere('p.column_name  NOT IN ( :id)')
            ->setParameter('id', array_keys($id)[0])
            ->orWhere('p.column_name  is null')  

Running Dql gives different Result in Symfony2.

  • any suggestion is most welcome.
afeef
  • 4,396
  • 11
  • 35
  • 65

1 Answers1

1

solution that i tried

        ->innerJoin('Bundle:Web', 'p', 'WITH', 'b.pid= p.id')
        ->where('a.code= :cust_id')
        ->andWhere('p.column_name  NOT IN ( :id) or p.column_name  is null ')
        ->setParameter('id', array_keys($id)[0])

here in above dql it saves orWhere condition in dql.

afeef
  • 4,396
  • 11
  • 35
  • 65