GROUP/ORDER BY Suggestions
It would be nice, if the suggestions list for GROUP BY would include all the all the not aggregated SELECT list columns first.
For ORDER BY, all the columns/aliases or their ordinal, and add checkbox for ASC/DESC.
SQL Prompt 6.5 now suggests the non-aggregated columns first for GROUP BY, with aggregated columns suggested first in HAVING clauses. You can download this version from http://www.red-gate.com/products/sql-development/sql-prompt/
-
Jason Clements commented
-
Ed commented
I would definitely like to see Intellisense included for aliases in ORDER BY.
For example:
SELECT [Strategy#] AS 'Strat#', [Date] AS 'Current Date' FROM [Table]
ORDER BY [Strat#], [Current Date]After you type in ORDER BY, it would be most helpful if [Strat#] and [Current Date] were suggested.
-
John Trumbul commented
I was just about to add this for a feature request. I don't really care about the ORDER BY but when you have queries that go across multiple servers and include an extremely long list of aggregates this would be a huge help. In a profession where small victories keep developers / DBAs happy this one would def keep me smiling!
-
Richard commented
Aaron Bauman: I'm totally agree!
Richard
-
Aaron Bauman commented
I can see maybe not doing this for ORDER BY, but GROUP BY is just an obvious choice. I have a snippet that when I type "gb" it gives me "GROUP BY", it sure would be nice if it just kicked out the rest of the aggregated columns!
-
Matt commented
The group by bit ALWAYS catches me out. I can see no reason why SQL could not just assume grouping if some parameters are aggregates.