How can we help you today? How can we help you today?

Formatting after JOIN

When using SQL Prompt > Format SQL when using the JOIN statement the table name and join condition are indented and placed on the next line (which is my preference).

If I user an INNER JOIN, LEFT JOIN or RIGHT JOIN however, the table name and join condition are placed immediately after the join statements on the same line.

Is it possible to force the INNER JOIN etc. formatting to behave the same way as JOIN?
Arcom
0

Comments

3 comments

  • Aaron L
    Hi Arcom,
    I'm not sure I'm seeing the same behaviour you've described when I try it here. Would it be possible to post a small script that shows what you're currently seeing and how you'd like it instead?

    Thanks,
    Aaron.
    Aaron L
    0
  • Arcom
    Hi Aaron,

    SELECT * FROM Dept d INNER JOIN Employee e ON d.DeptId = e.DeptId

    reformats to
    SELECT
       *
    FROM
       Dept d
    INNER JOIN Employee e ON d.DeptId = e.DeptId
    

    whereas

    SELECT * FROM Dept d JOIN Employee e ON d.DeptId = e.DeptId

    reformats to
    SELECT
       *
    FROM
       Dept d
    JOIN
       Employee e ON d.DeptId = e.DeptId
    

    My preference is for the latter, but I can't find an option to set this

    Thanks

    Andy
    Arcom
    0
  • Aaron L
    Thanks for the example!

    I've logged this request as SP-5079 in our internal tracking system. We will be looking to improve the flexibility of the formatting system in Prompt in the future so this request will be helpful when we consider the list of rules.

    If you have any more suggestions please feel free to post them here!

    Thanks,
    Aaron.
    Aaron L
    0

Add comment

Please sign in to leave a comment.