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)
 How do I cross reference rows in a table with itself

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2001-04-22 : 21:13:24
Bob writes "We are building a database which will store news articles and would like to be able to relate articles. We therefore need to create a lookup table with article id's and related article id's.

We need to be able to look-up related articles "both ways" eg

Article 1 has related articles 4, 8, 12
and article 4 has related articles 1, 9, 25

What would be the best solution?

we currently have a lookup table cosnsisting of two columns:

articleid
relatedarticleid

so for the above example it would have rows:

articleid   relatedarticleid
--------- ----------------
1 4
1 8
1 12
4 1
4 9
4 25


What relationship should we have between this table and the main articles table

thanks in advance

Bob"
   

- Advertisement -