facetable_by_state (view)
3 rows
Suggested facets
| state | row_count | planet_total | avg_on_earth |
|---|---|---|---|
| CA | 10 | 10 | 1.0 |
| MC | 1 | 2 | 0.0 |
| MI | 4 | 4 | 1.0 |
View definition
CREATE VIEW facetable_by_state AS
SELECT
state,
count(*) AS row_count,
sum(planet_int) AS planet_total,
avg(on_earth) AS avg_on_earth
FROM facetable
GROUP BY state;