Data & SQL21 categories
Port this query to another SQL dialect
Moving a query between Postgres, BigQuery, Snowflake, MySQL, or SQLite.
Convert the query below from the source dialect to the target dialect. Rules: - Produce a working query, not a sketch. - After it, list every change you made and why, grouped: syntax, function names, date and interval handling, string functions, type casting, NULL and empty-string semantics, quoting and case sensitivity. - Call out any behaviour that differs even though the syntax converts cleanly. Particularly: integer division, implicit casts, ordering of NULLs, string comparison collation, DISTINCT with NULLs, and how each dialect treats division by zero. - Where the target has no equivalent, give the closest workaround and state what is lost. Flag anything I must verify against real data rather than trust the conversion for. Source dialect: Target dialect: Query:
Making it yours
- Paste your own material where the prompt asks for it. Everything above that line is instruction, not content.
- Delete any rule that does not apply to you. A shorter prompt that fits beats a thorough one that does not.
- If the answer comes back vague, add a line saying what you do not want. Constraints work better than encouragement.
Writing and reading queries. Drafting SQL from a plain question, making an inherited query legible, and moving it between dialects.
Related prompts
Explain this query to me line by lineYou inherited a 200-line query and need to understand it before changing it.Write the query from a plain-language questionYou know exactly what you want to know and not how to express it in SQL.Solve this with a window functionYou're about to write a self-join and suspect there's a cleaner way.Build and explain a spreadsheet formulaWhen the lookup keeps returning N/A and the nesting is four deep.Explain this query in three sentencesSomeone handed you a query and you need the gist before you touch it.Rewrite this without nested subqueriesFour levels of nesting and nobody can read it, including you.
Keep this one
Phrasery saves prompts with a right-click and puts them back the same way. Add this to your own library in one click.
Add to your browser โ free