Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Getting from distance for geography coordinates
Message
From
22/11/2011 12:03:58
 
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Environment versions
SQL Server:
SQL Server 2008
Application:
Web
Miscellaneous
Thread ID:
01529492
Message ID:
01529544
Views:
19
>>>Right, but it was in the original select statement as well. I want to attempt to filter data first as it was using and then apply distance filter. In case of CTE it may not be relevant, but in case of temp table it will.
>>
>>
>>No, this was the original SQL Re: Getting from distance for geography coordinates Thread #1529492 Message #1529521
>>
>>Relevant or not - it's sloppy programming to say the least
>
>I don't understand you. If that condition was in the original SQL Statement, do we want to preserve it or not? I assume that this condition does a rough filtering and then distance filtering is more precise. If this assumption is correct, then we may want to use this 'rough' filtering first to get less records and then apply more precise filtering based on the computed column.

Your cte already returns records where the distance is less than or equal to 250

Then why select from the cte the set where the distance is less than or equal to 250 ? You don't need the second where
Gregory
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform