A one-line SELECT
- SQL query
- select a,b from t where x=1 and y=2
- Keyword case
- UPPERCASE
- Indent with
- 2 spaces
Result Formatted SQL: SELECT
a,
b
FROM
t
WHERE
x = 1
AND y = 2
Statements: 1
Lines: 8
Keywords: 4
Tokens: 14
- Split the input into 14 tokens: words, numbers, quoted strings, comments and symbols.
- Started a new line at each main clause (SELECT, FROM, WHERE, GROUP BY, ORDER BY and so on) and each JOIN, AND or OR.
- Broke column lists after each comma outside function brackets and indented subqueries by two extra levels.
- Applied uppercase to 4 keywords; the result has 8 lines.
Each clause gets its own line, the two columns are listed one per line, and the AND condition starts a fresh indented line.