How to 'SELECT FROM {entity_bundle} WHERE field_A + field_B <= given_number_X' with EntityFieldQuery
I dont believe you can do this with the core methods provided by the EFQ api.

But, you may always extend the default EFQ class with a version of your own. Or, you may implement a function such as hook_entity_query_alter() or the addTag() method of EFQ.

Using addTag for instance on the EFQ you could then also implement hook_query_TAG_alter() and alter the SelectQuery that is ultimately called from the original EFQ and alter the base query to include your additional (non-standard) logic.

This could look like this short example, we additionally use the SelectQuery::where() method:

// Within some function of yours, you execute your query; giving it a Tag.
$query = new EntityFieldQuery();
$query-&gt;entityCondition('entity_type', 'node')
  -&gt;entityCondition('bundle', 'MYCONTENTTYPE')
  // Must call the method fieldCondition on field_A and field_B so
  // they get included in the SQL INNER JOIN statement.
  -&gt;fieldCondition('field_A')
  -&gt;fieldCondition('field_B')
  -&gt;addTag('DoFunkyFieldLogic');
$query_result = $query-&gt;execute();

// ... elsewhere in your custom module ...

// Implements hook_query_TAG_alter
function mymodule_query_DoFunkyFieldLogic_alter(QueryAlterableInterface $query) {
  if ($query-&gt;hasTag('DoFunkyFieldLogic')) {
    // You will likely need to install Devel and call dpm($query) here.
    // Or else you wont know what the field names are in the raw SQL ...
    // you might be able to cheat and use full database table names and
    // column names, eg:
    //dpm($query);
    $query-&gt;where("field_data_field_A1.field_A_value + field_data_field_B2.field_B_value &lt;= :my_quantity", array(':my_quantity' =&gt; variable_get('my_quantity', 5));
  }
}


There may be cleaner ways to do this -- but this approach is relatively straight forward. This code is untested; but should work.