In a previous post, I showed how you might use split windows to allow you to work on different parts of a single query at the same time.
But what if you need to work on two queries and see parts of both of them?
That's where tab groups can help you. You can create both vertical and horizontal groups. For me, the most useful is typically side-by-side vertically, for when I'm comparing two sections of code.
From the Window menu, I choose New Vertical Tab Group:
After I click that, as long as there are two or more queries open, I'll see this:
I then have two queries that I can work with side-by-side. A horizontal tab group places them one above the other.
In the image above, I had two queries in the left group, and one in the right group. You can also move queries between these groups. If I right-click the tab heading for one of the queries, I see this:
I can create yet another tab group based on this tab, or move it to the next tab group, or even close this tab group by moving all tabs within it to the next tab group.