I need help to do this:
TABLE POSITION
ID, int (PK)
SN, varchar(10)
Lat, double
Lon, double
etc...
TABLE ACTUAL_POSITION
SN, varchar(10) (PK)
Lat, double
Lon, double
When records are inserted in the first table, corresponding (by SN) record should be updated in the second table. If no SN record is found in that table, it should be created.
Multiple records are inserted in the first table at the same time, even for the same SN, so I need to extract the very last Lat and Lon for every single SN (when vehicles are out of connection range they buffer the data to send and then send it all togheter, so the receiving sw writes into sql in a single pass) from the inserted table.
1 Answer