SQL formatter
Make SQL easier to read in your chosen dialect.
SQL formatter
วิธีใช้ SQL formatter
SQL formatter reformats a SQL query so each clause, such as SELECT, FROM, WHERE and ORDER BY, starts on its own line with its items indented below. You choose the dialect: standard SQL, PostgreSQL, MySQL, SQLite or Transact-SQL. Keyword case is kept as you typed it, and the query is only formatted, never run.
- Paste the source into the input editor, or load the built-in example.
- Set sql dialect.
- Run sql formatter, review the output, then use the available copy or download controls.
ความสามารถของเครื่องมือนี้
Make SQL easier to read in your chosen dialect.
- SQL dialect
- sql · postgresql · mysql · sqlite · transactsql
ข้อจำกัดและการประมวลผล
Text operations generally accept up to 2,000,000 characters. Individual parsers, generators and formulas apply additional limits shown by their controls.
ตัวอย่างข้อมูลนำเข้า
select id, name from people where active=true order by name
คำถามที่พบบ่อย
Which SQL dialects can I format?
The SQL dialect setting offers standard SQL, PostgreSQL, MySQL, SQLite and Transact-SQL. Choosing the dialect that matches your database helps the formatter recognize its specific syntax.
Does the SQL formatter change keywords to uppercase?
No. Keywords keep the case you entered, so a lowercase select stays lowercase. The formatter changes line breaks, indentation and spacing around operators.
Can I format several SQL statements at once?
Yes. Paste multiple statements separated by semicolons and each one is laid out on its own lines with the same dialect rules.
Where is my input processed?
This operation processes its source in your browser. Copy and download are explicit actions; source input is not saved in an account or history.
What are the input limits?
Text operations generally accept up to 2,000,000 characters. Individual parsers, generators and formulas apply additional limits shown by their controls.