When editing a query in SQL Server Management Studio (SSMS), the Query Editor Window can be split horizontally, so you can work on different parts of the same query at the same time.
Click 'Window' -> 'Split':
You can split the Query Editor Window by clicking and dragging the splitter bar down.
Depending on the version of SSMS you are using, the splitter bar will look like this:
...or like this:
When the Query Editor Window is split, you can work on different parts of the same query at the same time:
To remove split, Click 'Window' -> 'Remove Split':
...or by dragging the lower pane back up.