medoo::avg PHP 메소드

avg() 공개 메소드

public avg ( $table, $join, $column = null, $where = null )
    public function avg($table, $join, $column = null, $where = null)
    {
        $query = $this->query($this->select_context($table, $join, $column, $where, 'AVG'));
        return $query ? 0 + $query->fetchColumn() : false;
    }

Usage Example

예제 #1
0
 /**
  * @param      $table
  * @param      $column
  * @param null $where
  * @return int
  */
 public function avg($table, $column, $where = NULL)
 {
     if (empty($this->_reader)) {
         return $this->_writer->avg($table, $column, $where);
     } else {
         return $this->_reader->avg($table, $column, $where);
     }
 }