Option C is not correct because it says “To order results by distance from a latitude or longitude”. This implies that you can order results by distance from either a latitude or a longitude, but not both. However, the DISTANCE function requires both a latitude and a longitude to calculate the distance from a location. Therefore, you cannot order results by distance from a latitude or longitude, but only from a latitude and longitude pair.
Just to add, I think you can only get the location but not the distance this way.
SELECT Name, Location__latitude__s, Location__longitude__s
FROM Warehouse__c
SELECT Name, StreetAddress__c
FROM Warehouse__c
WHERE DISTANCE(Location__c, GEOLOCATION(37.775,-122.418), 'mi') < 20
ORDER BY DISTANCE(Location__c, GEOLOCATION(37.775,-122.418), 'mi')
LIMIT 10
upvoted 3 times
...
Log in to ExamTopics
Sign in:
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one.
So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
rodmfpwc
Highly Voted 3 years, 9 months agobeardAnt
Most Recent 1 month, 1 week agomoitam
1 year, 2 months agocode_breaker_27
1 year, 1 month agolorenac2
1 year, 10 months agoLiquad
3 years, 1 month ago