Clear all

Breakline after WITH  



Breaklines after WITH keyword would be useful.

Hi Kevin, thanks for your suggestion. The WITH keyword is used in many different ways. Could you please post an example and let me know for which DB you want this new formatting rule. Thx!

1 Answer

I tend to like to format my subqueries as below, this saves space and clearly separates them.  The closed parens, the comma, the name, and the open parens are all on one line.  Does this look like a feature that might be incorporated?

WITH sqry1 AS (
SELECT col1, col2 FROM tbl1
), sqry2 AS (
SELECT col1, col3 FROM tbl2
), sqry3 AS (
SELECT col1, col4 FROM tbl3
SELECT col1, col2, col3, col4
tbl1 t1
INNER JOIN tbl2 t2 ON (t1.col1 = t2.col2)
INNER JOIN tbl3 t3 ON (t1.col1 = t3.col1)
INNER JOIN tbl4 t4 ON (t1.col1 = t4.col1)

Hi Ken,
thanks for your suggestion. I am doing a major refactoring job after adding new feattures for 15 years now. I will keep your suggestion on my todo list

Your Answer

Preview 0 Revisions Saved