I am using an OGR connection to a shapefile in a MapServer map file in order to use SQL to get the last record in the shape. <br><br>I have tried to order it by an ID column descending and then use limit 1 or rownum = 1, these didn't work.
<br><br>I have also tried WHERE ID = MAX(ID), but I get an error message that indicates that MAX is being interpreted as a string and that the comparison is illegal.<br><br>
msOGRFileOpen(): OGR error. ExecuteSQL(SELECT FID, * FROM bryantrip WHERE FID = MAX(FID) ORDER BY timeLoc desc) failed.
SQL: Attempt to compare numeric field `FID' to non-numeric value `MAX' is illegal. <br><br>Can anyone suggest OGR SQL to get the last row of the shape? <br><br>Thanks, <br><br>David.<br>