sql lag function code example Example: sql latlng For longitudes use: Decimal(9,6), and latitudes use: Decimal(8,6)