How to add multiple havingCondition with OR operator?
Create OR conditions separately, in a variable, and then just use them:

$or = db_or()-&gt;condition('a', 0, '=')-&gt;condition('b', 0, '=')-&gt;condition('c', 0, '=');
$query-&gt;havingCondition($or);


For more details, read db_or documentation on Drupal API page. This should always be your first place to go, before you ask API-related questions.