Retrieves the count of the table
 @param [List of Hash/String] where Filter conditions
 @return [Fixnum] Count of the records.
544714
def count *where
    sql, *binds = SQLHelper.count :table => name, :where => @query_where + where, :prepared => true
    pstmt = prepare :count, sql
    pstmt.query(*binds).to_a[0][0].to_i
  end
317456
public int execSelectCount(Class<? extends D6Model> modelClazz, WhereCondition whereCondition) {

    final D6CrudSelectHelper d6CrudSelectHelper = new D6CrudSelectHelper(modelClazz);
    final String sqlForSelectCount = d6CrudSelectHelper.getSQLForSelectCount();

    String sql = sqlForSelectCount + " " + whereCondition.toSql();

    return execSelectCount(sql);
  }
1034010
def getNumTables(dbid)
      numTables = 0
      dbid ||= @dbid
      if getSchema(dbid)      
        if @chdbids
           chdbidArray = findElementsByAttributeName( @chdbids, "name" )
           numTables = chdbidArray.length
         end
       end
      numTables       
  end
1371264
function Count($where = null) {
		$this->LoadSchema();
		if ($this->UseCache('count')) {
			$cacheid = md5(json_encode($where));

			if ($value = $this->GetCache('count', $cacheid))
				return $value;
		}

		$this->ResetQuery(array(
			'method' => 'count',
			'table' => $this->table,
			'where' => $where,
		));

		$this->Trigger('access', $where);
		if (!$this->continue)
			return 0;

		$this->Trigger('pull', $where);
		if (!$this->continue)
			return 0;

		$this->Trigger('getall', $where);
		if (!$this->continue)
			return 0;

		$this->db->select('COUNT(*) AS count');
		$this->db->from($this->table);
		if ($where = $this->FilterFields($where, 'where'))
			$this->db->where($where);
		$row = $this->db->get()->row_array();
		if (!$this->continue)
			return 0;

		return isset($cacheid) ? $this->SetCache('count', $cacheid, $row['count']) : $row['count'];
	}
525623
def with(*conditions, &block)
      @filters ||= []

      @filters << {:negate => false, :filter => block} if block
      conditions.each do |condition|
        @filters << {:negate => false, :filter => condition}
      end
    end
1247839
def where(self, predicate):
        
        if predicate is None:
            raise NullArgumentError(u"No predicate given for where clause")
        return Enumerable3(filter(predicate, self))
790617
def where_clause(self):
        
        cond = self._make_condition(self.restriction)
        return '' if cond is True else ' WHERE %s' % cond
945510
def doQueryCount( dbid, query )
      @dbid, @query = dbid, query
      
      xmlRequestData = toXML( :query, @query )
      
      sendRequest( :doQueryCount, xmlRequestData )

      @numMatches = getResponseValue( :numMatches )

      return self if @chainAPIcalls
     @numMatches
   end
719631
public function count($table = '', $where = '')
    {
        // if table name not pass
        if (!empty($table)) {
            if (empty($where)) {
                $this->sql = "SELECT COUNT(*) AS NUMROWS FROM `$table`;"; // create count query
            } else {
                $this->sql = "SELECT COUNT(*) AS NUMROWS FROM `$table` WHERE $where;";  // create count query
            }

            // pdo prepare statement
            $this->STH = $this->prepare($this->sql);

            try {
                if ($this->STH->execute()) {
                    // fetch array result
                    $this->results = $this->STH->fetch();
                    // close pdo
                    $this->STH->closeCursor();
                    // return number of count
                    return $this->results['NUMROWS'];
                } else {
                    self::error($this->STH->errorInfo());
                }
            } catch (\PDOException $e) {
                // get pdo error and pass on error method
                self::error($e->getMessage() . ': ' . __LINE__);
            }
        } else {
            self::error('Table name not found..');
        }
    }
334863
async def count(query, clear_limit=False):
    
    clone = query.clone()
    if query._distinct or query._group_by or query._limit or query._offset:
        if clear_limit:
            clone._limit = clone._offset = None
        sql, params = clone.sql()
        wrapped = 'SELECT COUNT(1) FROM (%s) AS wrapped_select' % sql
        raw = query.model.raw(wrapped, *params)
        return (await scalar(raw)) or 0
    else:
        clone._returning = [peewee.fn.Count(peewee.SQL('*'))]
        clone._order_by = None
        return (await scalar(clone)) or 0
607421
def filter(cls, start_position="", max_results="", qb=None, **kwargs):
        
        return cls.where(build_where_clause(**kwargs),
                         start_position=start_position, max_results=max_results, qb=qb)
569093
public int queryObjCountByCondition(String tableName, String condition){
		/*		JdbcTemplate jdbcTemplate = (JdbcTemplate) MicroDbHolder
		.getDbSource(dbName);*/
		//String tableName=changeTableNameCase(otableName);
		JdbcTemplate jdbcTemplate = getMicroJdbcTemplate();
		String sql="";
		sql="select count(1) from " + tableName + " where "+condition;
		logger.debug(sql);
		Integer total=jdbcTemplate.queryForObject(sql,Integer.class);
		return total;
	}
521176
def getTableCount(verbose=None):
        

        response=api(url=self.url+'tables/count', method="GET", verbose=verbose, parse_params=False)
        return response
1263489
async def count(self, query, clear_limit=False):
        
        query = self._swap_database(query)
        return (await count(query, clear_limit=clear_limit))
681577
def empty?
      return @records.empty? if loaded?

      c = count
      c.respond_to?(:zero?) ? c.zero? : c.empty?
    end
424176
def where(filter)
      if filter.is_a?(String) # we got a Sparql snippet
        where_clauses << filter
      elsif filter.is_a?(Hash)
        filter.each_pair do |key, value|
          field = resource_class.get_field(key)
          value = RDF::Literal.new(value) unless value.respond_to?(:to_base)
          where_clauses << "?uri <#{ field.predicate }> #{ value.to_base }"
        end
      end
      self
    end
773373
protected function countResource(string $resource, array $where = null)
    {
        $model = $this->resources[$resource]['model'];
        $database = $model::getDatabase();
        return $database->count($model::TABLE, $where ?? []);
    }