--- android/TrainInfoService/src/dk/thoerup/traininfoservice/StationDAO.java 2010/05/18 17:56:43 733 +++ android/TrainInfoService/src/dk/thoerup/traininfoservice/StationDAO.java 2010/05/18 20:39:22 734 @@ -102,14 +102,12 @@ } public List getByLocation(double latitude, double longitude) throws SQLException { - String SQL = "SELECT * FROM ( "+ - " SELECT id,name,latitude,longitude,stationcode_fjrn,stationcode_stog, stationcode_metro, address," + - " earth_distance( earth_coord, ll_to_earth(?,?))::int AS calcdist " + - " FROM trainstations " + - " WHERE enabled = true " + - " ) AS trainstations2 " + - "ORDER BY calcdist ASC " + - "LIMIT 4 "; + String SQL = "SELECT id,name,latitude,longitude,stationcode_fjrn,stationcode_stog, stationcode_metro, address," + + " earth_distance( earth_coord, ll_to_earth(?,?))::int AS calcdist " + + "FROM trainstations " + + "WHERE enabled = true " + + "ORDER BY calcdist ASC " + + "LIMIT 4 "; List result; Connection conn = null; PreparedStatement stmt = null;