mirror of
https://github.com/FlipsideCrypto/ethereum-models.git
synced 2026-02-06 14:56:49 +00:00
25 lines
367 B
SQL
25 lines
367 B
SQL
{% test row_count(
|
|
model,
|
|
group_field,
|
|
count_field,
|
|
threshold
|
|
) %}
|
|
SELECT
|
|
row_count
|
|
FROM
|
|
(
|
|
SELECT
|
|
group_field,
|
|
COUNT(
|
|
{{ count_field }}
|
|
) AS row_count
|
|
FROM
|
|
{{ model }}
|
|
GROUP BY
|
|
1
|
|
)
|
|
WHERE
|
|
row_count <= {{ threshold }}
|
|
|
|
{% endtest %}
|