SoftTree Technologies SoftTree Technologies
Technical Support Forums
RegisterSearchFAQMemberlistUsergroupsLog in
Formatting Where Clause

 
Reply to topic    SoftTree Technologies Forum Index » SQL Assistant View previous topic
View next topic
Formatting Where Clause
Author Message
Daveii



Joined: 10 Dec 2008
Posts: 22
Country: United States

Post Formatting Where Clause Reply with quote
Using SQL Assist 6.1 with the following Formatted Code:

SELECT ... AS ...
,... = ...

FROM ... AS ...
,...

Join ... AS ...
ON ... = ...
AND ...
,...

Left ... AS ...
ON ... = ...
AND ...

Right ... AS ...
ON ... = ...
AND ...

WHERE ... = ...
AND ...
OR ...

GROUP BY
...
,...

HAVING ...
,...

union all ...

ORDER BY
...
,...

When this code is tested with the following input:

/* Enter your test SQL statements here */

select field1,field2,field3
from table1,table2
where (field1 > field2)or(field2 <field3> field2)or(field2 < field3)


Why is the Where clause indented?
Sun Feb 12, 2012 1:44 pm View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7849

Post Reply with quote
I think UNION ALL should not be there. UNION is not part of the SELECT query. You should create a separate rule for UNION .... Also, do not change comma positions in the SELECT code formatting, you should leave them as in the default setup and instead use dedicated "Commas" options into control comm positioning. hope this helps.
Sun Feb 12, 2012 3:37 pm View user's profile Send private message
gemisigo



Joined: 11 Mar 2010
Posts: 2109

Post Reply with quote
I tried it and though the WERE line did not get indented, it definitely gets an unwanted space at the start of the line and the line feed before it is missing.
Sun Feb 12, 2012 3:44 pm View user's profile Send private message
Display posts from previous:    
Reply to topic    SoftTree Technologies Forum Index » SQL Assistant All times are GMT - 4 Hours
Page 1 of 1

 
Jump to: 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


 

 

Powered by phpBB © 2001, 2005 phpBB Group
Design by Freestyle XL / Flowers Online.