Get the number of rows in a particular table.
436408
def count_rows(self, table, cols='*'):
        """"""
        query = 'SELECT COUNT({0}) FROM {1}'.format(join_cols(cols), wrap(table))
        result = self.fetch(query)
        return result if result is not None else 0
130412
@Override
    public int getRowCount() {
        String xpath = bodyTag.isPresent()
            ? "./tbody/tr"
            : "./tr";

        return getContext().find().elements(byInner(By.xpath(xpath))).size();
    }
992847
def _GetRow(self, columns=None):
        """"""

        row = self._table[self._row_index]
        if columns:
            result = []
            for col in columns:
                if col not in self.header:
                    raise TableError("Column header %s not known in table." % col)
                result.append(row[self.header.index(col)])
            row = result
        return row
406127
def count(self):
        
        count = 0
        operation = self._get_operation()
        kwargs = self.kwargs.copy()
        kwargs['select'] = 'COUNT'
        limit = kwargs.get('limit', None)
        while True:
            result = operation(self.model.get_table_name(), **kwargs)
            count += result['Count']
            if limit is not None:
                limit -= result['Count']

            last_evaluated_key = result.get('LastEvaluatedKey', None)
            if not self._prepare_next_fetch(kwargs, last_evaluated_key, limit):
                break
        return count
926035
protected function GetRemainingRowCount()
    {
        $aTableList = $this->aTablesToProcess;
        $iCount = 0;
        foreach ($aTableList as $iWorkId) {
            $oIndexQuery = TdbShopSearchQuery::GetNewInstance();
            /** @var $oIndexQuery TdbShopSearchQuery */
            if ($oIndexQuery->Load($iWorkId)) {
                $iCount = $iCount + $oIndexQuery->NumberOfRecordsLeftToIndex();
            }
        }

        return $iCount;
    }
14481
def fetchall(self):
        """"""
        self._check_executed()
        if self._rows is None:
            return ()
        if self.rownumber:
            result = self._rows[self.rownumber:]
        else:
            result = self._rows
        self.rownumber = len(self._rows)
        return result
508510
def rows(self):
        """"""
        bf = self.copy()
        result = bf.query.executeQuery(format="soa")
        return result["_rowName"]
274894
public function getTotalSelectedRowsWithoutLimit(): int
    {
        if (!$this->require_to_count_total_rows) {
            dump('You need to call setRequireCountRowsWithoutLimits(true) before requesting result');
        }

        $this->collectObjects();

        return (int)$this->total_count_rows;
    }
613228
def count(self, model_class, conditions=None):
        '''
        
        '''
        query = 'SELECT count() FROM $table'
        if conditions:
            query += ' WHERE ' + conditions
        query = self._substitute(query, model_class)
        r = self._send(query)
        return int(r.text) if r.text else 0
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..');
        }
    }
822588
def get_number(self, num, table=None):
        """"""
        if table is None: table = self.main_table
        self.own_cursor.execute('SELECT * from "%s" LIMIT 1 OFFSET %i;' % (self.main_table, num))
        return self.own_cursor.fetchone()
1239815
public static int getRowCount(Connection connection, String tableReference) throws SQLException {
        Statement st = connection.createStatement();
        int rowCount = 0;
        try {
            ResultSet rs = st.executeQuery(String.format("select count(*) rowcount from %s", TableLocation.parse(tableReference)));
            try {
                if(rs.next()) {
                    rowCount = rs.getInt(1);
                }
            } finally {
                rs.close();
            }
        }finally {
            st.close();
        }
        return rowCount;
    }
81478
def rows(self, table, cols):
        '''
        
        '''
        if self.orng_tables:
            data = []
            for ex in self.orng_tables[table]:
                data.append([ex[str(col)] for col in cols])
            return data
        else:
            return self.fetch(table, cols)
214959
public int count(String where, String[] args) {
		return db.count(getTableName(), where, args);
	}
1266688
def count(self, q='*:*', fq=None):
        """"""
        params = {'q': q, 'rows': '0'}
        if fq is not None:
            params['fq'] = fq
        res = self.search(params)
        hits = res['response']['numFound']
        return hits
783753
def count(self):
        
        cmd = ("select COUNT(*) from {table} "
               "{join_clause}{where_clause}{order_clause}").format(
                    table=self.table_name,
                    where_clause=self.where_clause,
                    join_clause=self.join_clause,
                    order_clause=self.order_clause).rstrip()
        return Repo.db.execute(cmd, self.where_values)
843774
private int getRowWidth() {
		int returnVal = 1;
		if (rows.size() < 1) {
			returnVal = 0;
		}
		for (int i = 0; i < rows.size(); i++) {
			if (rows.get(i) instanceof Row) {
				returnVal = ((Row) rows.get(i)).getRowWidth();
			}
		}
		return returnVal;
	}