One task · six dialects

The same SQL, in every dialect.

Running totals, top-N per group, dedup with ROW_NUMBER, pivot/unpivot, upsert, JSON and recursive CTEs — each shown in MySQL, PostgreSQL, SQLite, BigQuery, Snowflake and DuckDB, with the gotchas that bite between them.

19 recipes

You know the query. You don't remember which dialect spells it which way.

Each recipe puts the task on one page with the exact syntax per dialect, side by side, plus the traps (argument order, version requirements, NULL handling).

FAQ

Are these SQL recipes free?

Yes. Every recipe is free to read and copy, with no account or paywall.

Which databases are covered?

Each recipe shows MySQL (8+), PostgreSQL, SQLite (3.25+), BigQuery, Snowflake and DuckDB, with version notes where they matter.

Why does the same query differ between databases?

Each engine grew its own functions — STRING_AGG vs GROUP_CONCAT vs LISTAGG, ON CONFLICT vs ON DUPLICATE KEY vs MERGE. The recipes give you the right one per engine.

Is this the same as datesql?

No overlap: datesql covers date/time across dialects; sqlindex covers everything else (windows, aggregation, upsert, JSON, CTEs).

Open the full interactive site ↗