SQL previous record - TechRepublic
Question
March 6, 2009 at 07:46 PM
phamyh

SQL previous record

by phamyh . Updated 17 years, 4 months ago

I would like to find the previous Speed to all cars in a database and compare it to the last speed it was changed by date. Then do a count of how many times it was changed. Can someone help? Thanks.

Example:

CarNum DorDate SpeedoEnd PrevEnd
16 5/1/2008 337374
16 5/2/2008 337538 337374
16 5/3/2008 337898 337538
16 5/4/2008 338212 337898
17 5/1/2008 201371
17 5/2/2008 201519 201371
17 5/3/2008 201784 201519
18 5/1/2008 196520
18 5/2/2008 196719 196520
18 5/3/2008 196774 196719

This discussion is locked

All Comments