Check Sequence

Thers are three buses running for a school. Bus No's are 1,2 and 3.
for eg :

Bus No.1 should travel via the following stops in a given sequence

Stop Name Sequence
Stop1 1
Stop2 2
Stop3 3
Stop4 4
Stop5 5

Bus No.2 should travel via the following stops in a given sequence

Stop Name Sequence
Stop1 1
Stop4 2
Stop2 3
Stop3 4
Stop5 5

Bus No.3 should travel via the following stops in a given sequence

Stop Name Sequence
Stop4 1
Stop3 2
Stop2 3
Stop5 4
Stop1 5

Whenever a bus touch any stop the record and time of the bus arrival is been entered in to system

now i want that when the record is entered it should check if the particular bus has come through the proper sequence which means it has not skipped the

pervious stop.
if it has been skipped then record should not be inserted...

how do i check this in SQL?

Can some one give me a rough idea how to tacke this ...

Thanx in Advance
[1243 byte] By [sr_aneesh] at [2007-11-19 4:02:57]
# 1 Re: Check Sequence
If you are rcording the time the bus arrives at the stop then you can use that too check the sequence in which the bus arrived at the stop by usiing an ORDER BY caluse in our SQL statement. You could alternitivley record the previous stop.
visualAd at 2007-11-8 0:20:19 >