I recently upgraded my Toad for Oracle from free version to 12 and ran into an issue with the Query Builder. Examine the following sql assembled by QB:
SELECT FIELD1, COUNT( FIELD2) “CNT”
FROM MYTABLE
GROUP BY FIELD1
ORDER BY FIELD1
The results of this query looked something like:
VALUE1 5
VALUE1 3
VALUE1 2
VALUE2 3
VALUE2 6
Where the results should have appeared as:
VALUE1 10
VALUE2 9
The issue turned out to be the space between the “COUNT(” and the “FIELD2)”. Changing COUNT( FIELD2) to COUNT(FIELD2) resolved the issue. When I copied the SQL over to Editor it worked fine, even with the space. When I sent the Editor over to Query Builder (without the space), Query Builder again added the space that I had to remove. The space does not appear in the Query Browser window (tree) but shows up in the Generated Query window.
I did not find any configurable option that might be influencing this behavior. The closest I could find is in the Formatter options where I have Parentheses set to compact (no spaces).