Menu
On this page

Query & analyze

The SQL GoPie speaks

Every query you write — in the playground, in a view definition, over the API — runs against the same analytical SQL dialect. It's a modern, analyst-friendly dialect: the same SQL works identically everywhere in GoPie, so nothing you learn on one screen surprises you on another.

Rely on what never changes

  • Read-onlySELECT, WITH, DESCRIBE, and SUMMARIZE. Writes are rejected.
  • One statement per request.
  • Double-quoted identifiers"column name" — for names with spaces or mixed case.
  • API query requests return at most 1,000 rows each (the playground shows 200); exports have no cap.

Conveniences worth knowing

The dialect is generous with analyst shortcuts:

-- Instant per-column statistics for a whole table
SUMMARIZE gp_orders;
 
-- FROM-first syntax reads the way you think
FROM gp_orders SELECT category, SUM(amount) GROUP BY category;
 
-- Select columns by regex, or everything except a few
SELECT COLUMNS('sales_.*') FROM gp_orders;
SELECT * EXCLUDE (internal_id, raw_json) FROM gp_orders;
 
-- Work on a sample while exploring something huge
SELECT * FROM gp_orders USING SAMPLE 10%;

Also in the everyday toolkit: date_trunc and strftime for time work, approx_count_distinct for fast cardinality, and full window-function support.

Feature availability

CapabilityAvailable
SELECT / WITH / DESCRIBE
SUMMARIZE
Playground local validation & auto-run
Version history & time travel
AI SQL generation
Note

The dialect only matters for SQL you write by hand. The AI bar and chat generate matching SQL for you automatically.