 |
SoftTree Technologies
Technical Support Forums
|
|
Author |
Message |
Daveii
Joined: 10 Dec 2008 Posts: 22 Country: United States |
|
Formatting Where Clause |
|
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 |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7948
|
|
|
|
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 |
|
 |
gemisigo
Joined: 11 Mar 2010 Posts: 2165
|
|
|
|
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 |
|
 |
|
|
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
|
|
|