View latest data
.com - London Transport Service Vehicles on the web
You are not logged in.
Log-in Register
News
Fleet Data
Locations
Pictures
Articles
Forum
An all-new version of this website is now available at www.ltsv.com/sv/. These pages are no longer being updated.

Forum Post
Forum: Web Site
Topic: Diary of a Webmaster

Post
Created
By
Replies
A solution to an old problem; sorting mixed records.
Wed 06/07/05, 20:40
0 Replies
Lists of information, particularly in databases, need to be sorted. The problem with service vehicles is that while most are numbered and can be sorted by these, many do not have numbers. Having these in separate database tables would have resulted in some rather complex queries.
To keep things relatively simple, all SVs are being put in one table, sorted by a numeric field called SVID. For the numbered fleet this is simply the stock number, while unnumbered vehicles are first sorted by registration before being given SVIDs.
But wait a minute. What if a bus company buys an old vehicle? How would the SVIDs retain the registration number order? The solution has been to give unnumbered SVs SVIDs spaced 10 numbers apart. So if T920BBK happens to be 63560, then T406CDY would be 63570. Therefore if a T123CAA turns up later, it can be slotted in between. The only problems with this system will be if more than 9 additional vehicles are taken between two existing registrations, and cases where a fleetnumber is reused.


Showing Replies 1 to 0 of 0
Log-in to add your own reply.
Replies (Most recent at top)
Created
By