so i'm currently working with an oracle query that i want to grab the maximum sighting_distance along with its corresponding sighting_id value, however i keep running into the ORA-00923: FROM keyword not found where expected error. Any ideas how to fix this error?
SELECT TOP 1 SIGHTING_ID, sqrt(((-28 - LATITUDE)*(-28 - LATITUDE)) + ((151 - LONGITUDE)*(151 - LONGITUDE))) AS "SIGHTING_DISTANCE"
SELECT SIGHTING_ID, longitude, latitude
GROUP BY SIGHTING_DISTANCE
ORDER BY ASC;
SELECT TOP 1 does not exist in Oracle SQL. Select everything in a subquery, order the subquery, and then select everything again "where ROWMUM = 1". (There are many other ways to do this - if you have Oracle 12 there is a new feature very similar to "TOP 1".)