Another problem with Beautifier

Alexandre

Member
The NOT EXISTS is not working the same way as IN look the example bellow:


Code:
SELECT DISTINCT
       TA.FIELD_1,
       TA.FIELD_2,
       SUM(TB.FIELD_2) TOTAL
FROM   TABLE_A                  TA,
       TABLE_B                  TB
WHERE  TA.FIELD_1 = TB.FIELD_1
   AND NOT EXISTS (SELECT 1
                     FROM TABLE_C TC
                    WHERE TC.FIELD_2 = TA.FIELD_2)
   AND TA.FIELD_1 IN (SELECT TD.FIELD_1
                     FROM TABLE_D TD)
GROUP BY TA.FIELD_1,
         TA.FIELD_2
After beautifier became this :


Code:
SELECT DISTINCT TA.FIELD_1,
                 TA.FIELD_2,
                 SUM(TB.FIELD_2) TOTAL
  FROM TABLE_A TA,
       TABLE_B TB
 WHERE TA.FIELD_1 = TB.FIELD_1
   AND NOT EXISTS (SELECT 1
          FROM TABLE_C TC
         WHERE TC.FIELD_2 = TA.FIELD_2)
   AND TA.FIELD_1 IN (SELECT TD.FIELD_1
                        FROM TABLE_D TD)
 GROUP BY TA.FIELD_1,
          TA.FIELD_2
I dont like also the way it formats the DISTINCT clause, can we change it?
 
Of course it should be:

Code:
AND NOT EXISTS
    ( SELECT blah
      FROM   blah )
i.e. a newline before the opening bracket and the position advanced to line up with any other subquery ;)
 
Back
Top