|
netcop
Starting Member
12 Posts |
Posted - 2002-07-24 : 11:06:07
|
| Hello everyone!I have a table with buslines stored in it. For each line, two directions are defined. The information provided are the start busstop and the end busstop. For example i want from 'Victory Place' to 'Lakeside Software Park' then i have to checkthat the distance from the 'start busstop' is < then the 'end busstop'. So you get the right direction (in this case 1). When I want from 'Victory Place' to 'Mountain View' then I see that there is no direct connection to there, because the distance from 'V.P.' is higher. So I have to drive to the end station of the other direction - 'Lakeside Software Park' on direction 1.Then I can choose 'LSP' to 'Mountain View'I need a select statement which returns me the information, when I check 'Mountain View' as end-busstop, that there is only a indirect connection.And i need a statement that returns me the info that when i want from 'Mozart street' to 'V.P.' that i've to choose first to drive to LSP.Or both in one.Can any one send me a query for this?!create table lines (line int,direction int,busstop nvarchar(32),distance int )insert lines values (90,1,'Victory Place',0)insert lines values (90,1,'Event Hall',861)insert lines values (90,1,'Messe',1061)insert lines values (90,1,'Rosentaler Straße',1471)insert lines values (90,1,'Hauptm.-Hermann-Platz',2886)insert lines values (90,1,'Wine yard',3509)insert lines values (90,1,'Mozart street',3778)insert lines values (90,1,'Lakeside Software Park',4339)insert lines values (90,2,'Lakeside Software Park',0)insert lines values (90,2,'Mountain View',286)insert lines values (90,2,'Sumpfweg',547)insert lines values (90,2,'Stadion',1111)insert lines values (90,2,'Wine yard',1376)insert lines values (90,2,'Neugasse',1732)insert lines values (90,2,'Hauptm.-Hermann-Platz',2022)insert lines values (90,2,'Rosentaler Straße',3305)insert lines values (90,2,'Messe',3884)insert lines values (90,2,'Event Hall',4141)insert lines values (90,2,'Victory Place',5086)Any guidance would be gladly welcomedThanksMichael |
|