Recently I started working on a project. In which I want to fetch the last record inserted in the database.
Query is:
SELECT c.lat, c.lng, LAST(v.count)
FROM camera_camera c , camera_cameravehiclecount v
WHERE c.id = v.cameraid
I am using the LAST() aggregate function but I am getting this error:
1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '(v.count) from camera_camera c , camera_cameravehiclecount v WHERE c.id = v.came' at line 1
I cross checked the syntax from w3school but still I am getting this error. I am using DB4free as my online database.