Attribute comparison operators include: =, <, >, =<, =>, <>.
The following examples use the = operator; however, any of the attribute operators can be substituted.
Example 1:
SELECT * FROM table WHERE city='Austin'If the data source provider supports the = operator, the entire statement is delegated to the data source provider.
If the data source provider doesn't support the = operator, Spectrum Spatial will ask the data source provider to carry out the select clause without the WHERE clause.
SELECT * FROM tableSELECT * FROM <results from the delegation> WHERE city='Austin'
Example 2:
SELECT pop FROM table WHERE city='Austin'If the data source provider supports the = operator, the entire statement is delegated to the data source provider.
If the data source provider does not support the = operator, only part of the query is delegated, as follows:
SELECT pop,city FROM tableSELECT pop FROM <results from the delegation> WHERE city='Austin'Example 3:
SELECT pop FROM table WHERE UPPER(city)='Austin'The 'UPPER' function prevents Spectrum Spatial from delegating the query to the data source provider, even if the data source provider supports the = operator. This is due to Rule 5 for the SELECT clause where functions and operators cannot be delegated to data source providers. So this example is processed completely by Spectrum Spatial. It only asks the data source provider for the data to operate on, as follows:
SELECT pop,city FROM tableThe following is
executed by Spectrum Spatial:
SELECT pop FROM <results from the delegation> WHERE UPPER(city)='Austin'Example 4:
SELECT state FROM table WHERE pop/area=5000This example containing the '/' operator means the WHERE clause cannot be delegated when a function is included. So this example is processed completely by Spectrum Spatial. It only asks the data source provider for the data to operate on, as follows: The following is executed by Spectrum Spatial:
SELECT state, pop, area FROM tableSELECT pop FROM <results from the delegation> WHERE pop/area=5000