GROUP BY Examples - Latest

Spectrum Spatial Guide

Product type
Software
Portfolio
Locate
Product family
Spectrumâ„¢ software
Product
Spectrumâ„¢ software > Spatial > Spectrum Spatial
Version
Latest
ft:locale
en-US
Product name
Spectrum Technology Platform
ft:title
Spectrum Spatial Guide
Copyright
2025
First publish date
2007
ft:lastEdition
2025-03-07
ft:lastPublication
2025-03-07T10:28:48.112000

Example 1:

SELECT pop, city FROM table WHERE pop > 50000 GROUP BY city

If the data source provider supports GROUP BY, the entire query is delegated to the data source provider.

Example 2:

If a data source provider does not support GROUP BY but supports ORDER BY, then the delegated query will return an ORDER BY on the column to be grouped. Spectrum Spatial will then handle the GROUP BY using the results of the delegated query.

SELECT hhinc FROM table WHERE pop > 50000 GROUP BY hhinc ORDER BY city

would be delegated to the data source provider as:

SELECT hhinc FROM table WHERE pop > 50000 ORDER BY city

Spectrum Spatial would process the GROUP BY using the results of the delegated query:

SELECT hhinc FROM <results of the delegated query> WHERE pop > 50000 GROUP BY hhinc