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.
| Token | Alt | Meaning |
|---|---|---|
> | INTO, -> | Next song in the setlist (not necessarily a musical segue) |
>> | THEN | Both 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 |
~> | TEASE | Teased — 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. TheSETLISTdisplay marks a few well-known transitions, but query matching is purely positional. Help us improve the data.
Logical
Combine conditions inside a WHERE clause.
| Token | Meaning |
|---|---|
AND | Both conditions must hold |
OR | Either condition holds |
NOT | Negate 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).
| Token | Meaning |
|---|---|
> | 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.
| Token | Meaning |
|---|---|
SET1, SET2, SET3 | Refer to the first, second, or third set |
ENCORE | Alias for SET3 |
OPENED | First song of the named set: SET1 OPENED "..." |
CLOSED | Last song of the named set: SET2 CLOSED "..." |
OPENER | First song of the show overall (shorthand for SET1 OPENED). Accepts a segue chain: OPENER "A" > "B" |
CLOSER | Last 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 OPENER | Show did not open with this song |
NOT CLOSER | Show did not close with this song |
NOT ENCORE | Encore was not this song |
Dates and date ranges
| Form | Example | Notes |
|---|---|---|
| Four-digit year | 1977 | Exact year |
| Two-digit year | 77 | Always 19xx — the Dead were active 1965–1995 |
| Year range | 1977-1980 | Inclusive |
| Two-digit range | 77-80 | Same as above |
| Specific date | 5/8/77 | M/D/YY |
| Specific date (full) | 5/8/1977 | Same |
| ISO date | 1977-05-08 | YYYY-MM-DD format |
BEFORE 1976 | — | Strictly before that year |
AFTER 1985 | — | Strictly after |
IN 1977 | — | Alias for FROM (SHOWS IN 1977 = SHOWS FROM 1977) |
Era aliases
Named eras the Dead community uses. Spelled exactly as shown (case-insensitive).
| Era | Years | What it covers |
|---|---|---|
PRIMAL | 1965–1969 | Pigpen-era, Dark Star, Saint Stephen, the Eleven |
EUROPE72 (or EUROPE) | March–May 1972 | The legendary spring ‘72 European tour — date-bounded, not the whole calendar year |
WALLOFSOUND | 1974 | The Wall of Sound PA era |
HIATUS | 1975 | The year off (very few shows) |
BRENT_ERA (or BRENT) | 1979–1990 | Brent Mydland on keys |
VINCE_ERA (or VINCE) | 1990–1995 | Vince 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-1978orSHOWS 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.
| Field | Valid on | Meaning |
|---|---|---|
DATE | SHOWS, PERFORMANCES | Show date |
LENGTH | PERFORMANCES, SONGS | Performance duration (durations cover ~48% of performances) |
NAME | SONGS | Song name, alphabetical |
TIMES_PLAYED | SONGS | Number of times performed across the catalog |
POSITION | PERFORMANCES | Position 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;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:
| Format | Output |
|---|---|
TABLE | Aligned text table (default) |
JSON | One JSON object per row, suitable for piping into jq |
CSV | Comma-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 (>>)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"; -- NOTDates 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;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