Operators

This page lists every operator and reserved token in GDQL — segues, logical connectors, comparisons, date forms, era aliases, and output formats. Use it as a lookup table when you’re not sure which token to reach for.


Segue / sequence

Connects two song names inside a WHERE clause.

TokenAltMeaning
>INTO, ->Next song in the setlist (not necessarily a musical segue)
>>THENBoth songs in the same show, A before B, with at least one other song between them
NOT >NOT INTO, !>A was played but B was not the next song
!>>A was played, but B was not played later in the same show
~>TEASETeased — partial quote, not a full performance (requires tease data import)

Chains are exact: "A" > "B" > "C" only matches shows where all three appear in that order, adjacent in the setlist.

Not a real segue. The > operator means “next song in the setlist”, not “segued into musically.” Real segue data is hard to source at scale. The SETLIST display marks a few well-known transitions, but query matching is purely positional. Help us improve the data.


Logical

Combine conditions inside a WHERE clause.

TokenMeaning
ANDBoth conditions must hold
OREither condition holds
NOTNegate the next condition (e.g. NOT "Song", NOT PLAYED "Song")

AND binds tighter than OR. There is no parenthesization yet — keep complex queries simple, or break them into separate statements.


Comparisons

Used in WITH LENGTH and LENGTH(...) conditions. Duration data is sourced from archive.org recordings (~48% coverage).

TokenMeaning
>Greater than
<Less than
>=Greater than or equal
<=Less than or equal
=Equal
!=Not equal

Set position tokens

Used inside WHERE to filter by where a song appeared.

TokenMeaning
SET1, SET2, SET3Refer to the first, second, or third set
ENCOREAlias for SET3
OPENEDFirst song of the named set: SET1 OPENED "..."
CLOSEDLast song of the named set: SET2 CLOSED "..."
OPENERFirst song of the show overall (shorthand for SET1 OPENED). Accepts a segue chain: OPENER "A" > "B"
CLOSERLast song of the show overall. Accepts a segue chain: CLOSER ("A" > "B"). No space before paren needed: CLOSER("...") also works.
=Equality form for ENCORE: ENCORE = "..." (optional — ENCORE "..." works too)
NOT OPENERShow did not open with this song
NOT CLOSERShow did not close with this song
NOT ENCOREEncore was not this song

Dates and date ranges

FormExampleNotes
Four-digit year1977Exact year
Two-digit year77Always 19xx — the Dead were active 1965–1995
Year range1977-1980Inclusive
Two-digit range77-80Same as above
Specific date5/8/77M/D/YY
Specific date (full)5/8/1977Same
ISO date1977-05-08YYYY-MM-DD format
BEFORE 1976Strictly before that year
AFTER 1985Strictly after
IN 1977Alias for FROM (SHOWS IN 1977 = SHOWS FROM 1977)

Era aliases

Named eras the Dead community uses. Spelled exactly as shown (case-insensitive).

EraYearsWhat it covers
PRIMAL1965–1969Pigpen-era, Dark Star, Saint Stephen, the Eleven
EUROPE72 (or EUROPE)March–May 1972The legendary spring ‘72 European tour — date-bounded, not the whole calendar year
WALLOFSOUND1974The Wall of Sound PA era
HIATUS1975The year off (very few shows)
BRENT_ERA (or BRENT)1979–1990Brent Mydland on keys
VINCE_ERA (or VINCE)1990–1995Vince Welnick on keys, ending with Jerry’s death

Mind the gap. There is no built-in alias for the Keith Godchaux years (1971–1979). To query that stretch — including Cornell ‘77 and the rest of the late-’70s run — use an explicit year range: SHOWS FROM 1976-1978 or SHOWS FROM 1971-1978.


Sorting and limiting

ORDER BY and LIMIT work on most query types. Sort fields are a fixed whitelist — case-insensitive, never quoted.

FieldValid onMeaning
DATESHOWS, PERFORMANCESShow date
LENGTHPERFORMANCES, SONGSPerformance duration (durations cover ~48% of performances)
NAMESONGSSong name, alphabetical
TIMES_PLAYEDSONGSNumber of times performed across the catalog
POSITIONPERFORMANCESPosition within the setlist

Add ASC (default) or DESC after the field. LIMIT n caps the row count and is silently capped at 1000 — asking for LIMIT 5000 returns 1000 rows. There is no offset or pagination.

SHOWS FROM 1977 ORDER BY DATE DESC LIMIT 10;
SONGS ORDER BY TIMES_PLAYED DESC LIMIT 20;
PERFORMANCES OF "Dark Star" ORDER BY LENGTH DESC LIMIT 5;
▶ Try it in sandbox →

ORDER BY VENUE, ORDER BY CITY, and other ad-hoc fields are not supported — the parser rejects anything outside the whitelist above.


Output formats

After AS in SHOWS, SETLIST, and PERFORMANCES:

FormatOutput
TABLEAligned text table (default)
JSONOne JSON object per row, suitable for piping into jq
CSVComma-separated values
SETLIST(SHOWS only) Each row expanded with its full setlist inline
COUNT(SONGS only) Collapse to a single count

Examples in context

Segue tokens in WHERE

SHOWS WHERE "Scarlet Begonias" > "Fire on the Mountain";  -- segue (>)
SHOWS WHERE "Scarlet Begonias" >> "Fire on the Mountain";  -- with break (>>)
▶ Try it in sandbox →

Logical in WHERE

SHOWS WHERE PLAYED "Dark Star" AND PLAYED "Saint Stephen";  -- AND
SHOWS WHERE SET1 OPENED "Jack Straw" OR SET1 OPENED "Bertha";  -- OR
SHOWS WHERE PLAYED "Dark Star" AND NOT PLAYED "Saint Stephen";  -- NOT
▶ Try it in sandbox →

Dates and eras

SHOWS FROM 1977;  -- single year
SHOWS FROM 77-80;  -- year range
SETLIST FOR 5/8/77;  -- specific date
SETLIST 1977-05-08;  -- YYYY-MM-DD, FOR is optional
SHOWS FROM PRIMAL;  -- named era
SHOWS BEFORE 1976;
SHOWS AFTER 1985;
▶ Try it in sandbox →

Output formats

SHOWS FROM 1977 LIMIT 3 AS TABLE;
SHOWS FROM 1977 LIMIT 3 AS JSON;
SHOWS FROM 1977 LIMIT 3 AS CSV;
SHOWS FROM 1977 LIMIT 3 AS SETLIST;
SONGS WITH LYRICS("rose") AS COUNT;  -- COUNT format
▶ Try it in sandbox →

Try in Sandbox