I've got the below code
$query = \Drupal::database() ->select("excel", "e")->fields("e"); $group = $query->orConditionGroup() ->condition("grupindex", 1) ->condition("grupkodu", NULL); $query->condition($group); $excel_products = $query->execute()->fetchAll();
When I run
SELECT * FROM excel WHERE grupkodu = 1 OR grupkodu IS NULL, I get 1594 records, however the above code gives only 638 records, which means only grupkodu condition is taken into account. What is the proper way to apply OR?