Toad World® Forums

Formatter - JOIN clause on right side

#1

Hi,

Does anyone can help me to find proper settings for formatter to place JOIN clause on the right side of the row?

Example that i expect:

SELECT
*
FROM
table1 t1 JOIN
table2 t2 ON t2.key = t1.key JOIN
table3 t3 ON t3.key = t1.key JOIN
table4 t4 ON t4.key = t1.key;

Now I have:

SELECT
*
FROM
table1 t1
JOIN table2 t2 ON t2.key = t1.key
JOIN table3 t3 ON t3.key = t1.key
JOIN table4 t4 ON t4.key = t1.key;

#2

I tried also but no success.

Seems that ANSI syntax is not currently supported so detaily in formater.

Maybe proffi response from Toad tech guys should make final verdict.

#3

Currently we don’t have options to specify the position of the JOIN. I added it to the enhancements. (QP-420)

#4

Thnak you for reply.

I hope that this feature appears soon.

#5

Hi Andrzey,

We decided not to implement the option to position JOIN keywords at the right hand side, as this is only readable for "simple" code. For instance, consider this formatted snippet:

SELECT x
  FROM y
       JOIN z ON a = b
       JOIN z2 ON a2 = b2
       JOIN u
            JOIN v
                 JOIN w
                      JOIN z ON a = b
                      JOIN u ON c = d
                   ON c = d
              ON e = f
         ON k = l,
       x
       JOIN z ON a = b;

... where right positioning the JOINs would yield something like this:

SELECT x
  FROM y JOIN
       z ON a = b JOIN
       z2 ON a2 = b2 JOIN
       u JOIN
         v JOIN
           w JOIN
             z ON a = b JOIN
             u ON c = d
             ON c = d
           ON e = f
         ON k = l,
       x JOIN 
       z ON a = b;

... which IMHO is less readable.

Thanks for the suggestion anyways,
Andre

#6

Hi avergison,
It's been 5 years and actually I forogot about this :slight_smile:
Thanks anyway for replay - Im amazed.