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

Formatting of AND's in Joins

This may just be personal preference, but if the layout tool is going to place the "ON" statment onto the same line as the "JOIN" then it should also take any subsequent "AND"'s.


For example, at the moment this: -
SELECT *
FROM MyTable MT
	Join MyOtherTable MOT
		On MT.ID = MOT.FK
		AND MOT.Date < GetDate()

Is changed to: -
SELECT  *
FROM    MyTable MT
        Join MyOtherTable MOT On MT.ID = MOT.FK
                                 AND MOT.Date < GetDate()

Would it not be better to be: -

SELECT  *
FROM    MyTable MT
        Join MyOtherTable MOT On MT.ID = MOT.FK AND MOT.Date < GetDate()
[/code]
Plip
0

Comments

1 comment

  • Andras B
    Plip wrote:
    This may just be personal preference, but if the layout tool is going to place the "ON" statment onto the same line as the "JOIN" then it should also take any subsequent "AND"'s.


    For example, at the moment this: -
    SELECT *
    FROM MyTable MT
    	Join MyOtherTable MOT
    		On MT.ID = MOT.FK
    		AND MOT.Date < GetDate()
    

    Is changed to: -
    SELECT  *
    FROM    MyTable MT
            Join MyOtherTable MOT On MT.ID = MOT.FK
                                     AND MOT.Date < GetDate()
    

    Would it not be better to be: -

    SELECT  *
    FROM    MyTable MT
            Join MyOtherTable MOT On MT.ID = MOT.FK AND MOT.Date < GetDate()
    
    [/code]



    The nearest option we have is Operator placement, but that would not do exactly what you would like to have. While we have finalized the features for the current version, I file this option request for a future version.

    Reagards,
    Andras
    Andras B
    0

Add comment

Please sign in to leave a comment.