Display average from a column?
I'm not familiar with the computed field module and not sure I completely understand the relationships between your nodes and fields, but here's about how you should be able to get things working.

The first query seems like it would be alright if you'd remove that extra closing bracket and used fetchField() to retrieve the value:

$entity_field[0]['value'] = db_query('
   SELECT AVG(field_payment_review_value) FROM {field_data_field_payment_review}
')-&gt;fetchField();


The second one needs some more work. I'm assuming that you have review nodes with the ratings and every review node is linked to a business node with a reference field of some sort.

First I would get the nid-s of those review nodes that are linked to the current business node as an array (using fetchCol()) with something like this:

$nids = db_query('
  SELECT entity_id FROM {field_data_field_business_reference}
  WHERE field_business_reference = :nid AND entity_type = :type AND bundle = :bundle',
  array(':nid' =&gt; $entity-&gt;nid, ':type' =&gt; 'node', ':bundle' =&gt; 'review')
)-&gt;fetchCol();


Then get the average:

$entity_field[0]['value'] = db_query('
   SELECT AVG(field_payment_review_value) FROM {field_data_field_payment_review}
   WHERE entity_id IN (:nids) AND entity_type = :type AND bundle = :bundle',
   array(':nids' =&gt; $nids, ':type' =&gt; 'node', ':bundle' =&gt; 'review')
)-&gt;fetchField();


UPDATE:

To avoid the error you're getting you can try wrapping the code inside some if statements to make sure it won't be executed when necessary criteria is not met:

$node = menu_get_object();
if (isset($node-&gt;type) &amp;&amp; $node-&gt;type == 'venue') {
  // put the query that retrieves the nids here.
  if (is_array($nids) &amp;&amp; !empty($nids)) {
    // put the query that calculates the average here.
  }
}


If that's too restrictive you might get away with just this much:

  // put the query that retrieves the nids here.
  if (is_array($nids) &amp;&amp; !empty($nids)) {
    // put the query that calculates the average here.
  }