description |
---|
Returns the total number of records for the specified expression. |
- expression: The expression to evaluate the number of records. This parameter can either be * or a column name of any primitive data type. Using asterisk (*) will include rows that contain
NULL
. Specifying a column name will ignore rows haveNULL
in that column.
Examples
{% code title="Aggregate function example" %}
SELECT COUNT(transaction_count)
FROM eth.recent_blocks
-- 338293677
{% endcode %}
{% code title="Window function example" %}
SELECT "base_fee_per_gas",
COUNT("total_gas_used")
OVER(PARTITION BY "base_fee_per_gas") "count_total_gas_used"
FROM eth.recent_blocks
LIMIT 1
-- base_fee_per_gas, count_total_gas_used
-- 0.06, 61900
{% endcode %}