SQL Formatter Options

SELECT

Linebreak options for every clause of a SELECT statement, clause by clause: SELECT, FROM, INTO, WHERE, HAVING, GROUP BY, ORDER BY, WINDOW, OFFSET and the set operators UNION, EXCEPT and INTERSECT. Each clause has a Linebreak Before and a Linebreak After switch, which together decide whether the keyword gets its own line.

SELECT

IDOptionWhat it doesDefault
ID148FreeLinebreak After SELECT
LBA_SELECT
Starts the column list on the line after the SELECT keyword instead of on the same line.on
ID148 off
select dept_nbr,
       dept_name
from   dept
ID148 on
select
    dept_nbr,
    dept_name
from   dept

FROM

IDOptionWhat it doesDefault
ID182FreeLinebreak Before FROM
LBB_FROM
Puts FROM on a new line, separating the column list from the table list.on
ID143FreeLinebreak After FROM
LBA_FROM
Starts the table list on the line after FROM. Switch on when queries regularly read from several tables.on
ID182 off, ID143 off
select dept_nbr from dept, employee
ID182 on, ID143 on
select dept_nbr
from
    dept,
    employee

INTO

IDOptionWhat it doesDefault
ID185FreeLinebreak Before INTO
LBB_INTO
Puts INTO on a new line. Applies to SELECT … INTO in procedural code and to INSERT INTO.on
ID159FreeLinebreak After INTO
LBA_INTO
Starts the target list on the line after INTO.on
ID185 off, ID159 off
insert into employee (emp_nbr, emp_name)
values (1, 'Smith')
ID185 on, ID159 on
insert
into
    employee (emp_nbr, emp_name)
values (1, 'Smith')

WHERE

The WHERE clause has two independent levels: the position of the WHERE keyword itself, and the treatment of the AND / OR operators that join the individual conditions.

WHERE
IDOptionWhat it doesDefault
ID183FreeLinebreak Before WHERE
LBB_WHERE
Puts WHERE on a new line, which marks the beginning of the filter section.on
ID142FreeLinebreak After WHERE
LBA_WHERE
Starts the first condition on the line after WHERE. Combined with the option before, WHERE then occupies a line of its own.on
ID183 off, ID142 off
select dept_nbr
from   dept where dept_zip = '64521'
ID183 on, ID142 on
select dept_nbr
from   dept
where
    dept_zip = '64521'
WHERE Condition
IDOptionWhat it doesDefault
ID172FreeLinebreak Before AND/OR in WHERE Condition
LBB_WHERE_AND
Starts each new condition on its own line with the AND or OR leading it. Leading operators make the boolean structure of a long filter easy to scan.on
ID173FreeLinebreak After AND/OR in WHERE Condition
LBA_WHERE_AND
Puts the condition on the line after the operator, so that the operator alone terminates the previous line.off
ID174FreeIndent AND/OR in WHERE Condition
IND_WHERE_AND
Indents the AND / OR operators one level deeper than the WHERE keyword, which subordinates the conditions to the clause visually.off

Leading AND / OR operators make the boolean structure of a long filter readable top to bottom.

ID172 off
where dept_zip = '64521' and dept_nbr > 100 and active = 1
ID172 on, ID174 on
where dept_zip = '64521'
      and dept_nbr > 100
      and active = 1

HAVING

HAVING mirrors WHERE exactly, but filters after aggregation. The options are deliberately separate so you can format the two clauses differently.

HAVING
IDOptionWhat it doesDefault
ID184FreeLinebreak Before HAVING
LBB_HAVING
Puts HAVING on a new line.on
ID153FreeLinebreak After HAVING
LBA_HAVING
Starts the first condition on the line after HAVING.on
ID184 off, ID153 off
select dept_nbr, sum(salary)
from   employee
group by dept_nbr having sum(salary) > 100000
ID184 on, ID153 on
select dept_nbr, sum(salary)
from   employee
group by dept_nbr
having
    sum(salary) > 100000
HAVING Condition
IDOptionWhat it doesDefault
ID175FreeLinebreak Before AND/OR in HAVING Condition
LBB_HAVING_AND
Starts each condition of the HAVING clause on its own line, led by AND or OR.on
ID176FreeLinebreak After AND/OR in HAVING Condition
LBA_HAVING_AND
Puts the condition on the line after the operator.off
ID177FreeIndent AND/OR in HAVING Condition
IND_HAVING_AND
Indents the AND / OR operators of the HAVING clause one level deeper.off
ID175 off
having sum(salary) > 100000 and count(*) > 5
ID175 on, ID177 on
having sum(salary) > 100000
       and count(*) > 5

GROUP BY

IDOptionWhat it doesDefault
ID186FreeLinebreak Before GROUP BY
LBB_GROUPBY
Puts GROUP BY on a new line.on
ID145FreeLinebreak After GROUP BY
LBA_GROUPBY
Starts the grouping list on the line after GROUP BY.on
ID135FreeStack GROUP BY
LB_STACKLISTGROUPBY
Stacks the grouping columns one per line instead of running them together. Makes it obvious whether the GROUP BY matches the non-aggregated columns of the SELECT list.on

ID135 stacks the grouping columns, which makes it obvious whether they match the non-aggregated columns of the SELECT list.

ID186 off, ID135 off
select dept_nbr, job, sum(salary)
from   employee group by dept_nbr, job
ID186 on, ID145 on, ID135 on
select dept_nbr, job, sum(salary)
from   employee
group by
    dept_nbr,
    job

ORDER BY

IDOptionWhat it doesDefault
ID187FreeLinebreak Before ORDER BY
LBB_ORDERBY
Puts ORDER BY on a new line.on
ID144FreeLinebreak After ORDER BY
LBA_ORDERBY
Starts the sort list on the line after ORDER BY.on
ID136FreeStack ORDER BY
LB_STACKLISTORDERBY
Stacks the sort columns one per line, so that each column with its ASC or DESC is visible on its own.on
ID187 off, ID136 off
select dept_nbr from dept order by dept_name desc, dept_nbr
ID187 on, ID144 on, ID136 on
select dept_nbr
from   dept
order by
    dept_name desc,
    dept_nbr

WINDOW

IDOptionWhat it doesDefault
ID258FreeLinebreak Before WINDOW
LBB_WINDOW
Puts the WINDOW clause on a new line. WINDOW names a window definition once so several analytic functions can reuse it.on
ID258 off
select rank() over w from employee window w as (order by salary desc)
ID258 on
select rank() over w
from   employee
window w as (order by salary desc)

OFFSET

IDOptionWhat it doesDefault
ID257FreeLinebreak Before OFFSET
LBB_OFFSET
Puts OFFSET on a new line, together with the FETCH or LIMIT clause that usually follows it.on
ID257 off
select emp_name from employee order by emp_name offset 10 rows fetch next 20 rows only
ID257 on
select emp_name
from   employee
order by emp_name
offset 10 rows fetch next 20 rows only

UNION, EXCEPT, INTERSECT

IDOptionWhat it doesDefault
ID256FreeLinebreak Before UNION, EXCEPT, INTERSECT
LBB_UNION
Puts the set operator on a new line, so it separates the two queries it combines. Mutually exclusive with ID011.on
ID011FreeDouble Linebreak before/after UNION, EXCEPT, INTERSECT
LB_DOUBLEUNION
Surrounds the set operator with blank lines. In a chain of several UNIONs this is what makes the individual queries recognisable as blocks. Mutually exclusive with ID256.on

ID011 surrounds the operator with blank lines, which turns a chain of set operations into readable blocks.

ID256 off, ID011 off
select dept_nbr from dept union select dept_nbr from dept_archive
ID256 on, ID011 on
select dept_nbr
from   dept

union

select dept_nbr
from   dept_archive

Option IDs are identical across all SQLinForm editions (VS Code, JetBrains, SSMS, Notepad++, Online Formatter) and are the keys stored inside a profile file. Generated from properties.json 2026.8.21.0.