Align join, where, having conditions in SQL-like scripts, including Spark SQL, T-SQL, and more.
Improve the readability of your queries in seconds.
Designed for professional data practitioners.
Before
After
select ...
from table_1 as t1
join table_2 as t2
on t1.col_a = t2.col_a
and t1.col_bb = t2.col_bb
...
where col_1 >0
or col2 + col3 != 1
...
having count(col_x) > 0
and max(col_y) = 1
select ...
from table_1 as t1
join table_2 as t2
on t1.col_a = t2.col_a
and t1.col_bb = t2.col_bb
...
where col_1 > 0
or col2 + col3 != 1
...
having count(col_x) > 0
and max(col_y) = 1
Features
Instantly formats blocks of join, where, having conditions for vertical alignment.
Activate with a simple keyboard shortcut or via the Command Palette.
Usage
Open any scripts containing SQL-like syntax.
Press the keyboard shortcut to format the active file:
Windows/Linux:Ctrl+Alt+E
Mac:Cmd+Alt+E
Alternatively, open the Command Palette (Ctrl+Shift+P), type Align SQL conditions, and press Enter.
Best practices
Put AND, OR keywords in front of each condition to get the best results
Replace tabs with spaces in the script to avoid misalignment