Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 database & logic problem

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2001-03-13 : 17:08:53
Snowyn writes "this is regarding database and some logic. i hope someone can help me.
there are 3 tables: links, opentab & closedtab
the records in links look like this:
From To Distance
A B 3
A C 5
B F 2
C D 2

i will select the first 2 records & put them in opentab. then from there i will select the shortest distance & remove it to put it in closedtab. my problem now is how do i make a query to select the subsequent link of B which is B to F, and subsequent link of C which is C to D from the links table to be insert into opentab? in other words the query has to know which record it selected previously.
and another problem is if the 2 distance is the same (in the above case B->F,C->D)& by rule i should select B->F b'cos its previous link gave a shorter distance. how do i select it by refering to the previous record selected?
your help is highly appreciated."
   

- Advertisement -