Skip to content
| Marketplace
Sign in
Visual Studio Code>Formatters>Pretty Sql-condition AlignerNew to Visual Studio Code? Get it now.
Pretty Sql-condition Aligner

Pretty Sql-condition Aligner

LinZhang

|
3 installs
| (1) | Free
Align SQL join/where/having conditions vertically
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Pretty Sql-conditions Aligner

  • 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 
and 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
  and 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

  1. Open any scripts containing SQL-like syntax.
  2. 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.

Changing the Shortcut

If the shortcut conflicts with another command:

  1. Go to File > Preferences > Keyboard Shortcuts.
  2. Search for Align SQL conditions.
  3. Click the pencil icon to set a new keybinding.

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft