It is "fairly" simple.
You'd need a new table as Eliot mentioned and then you can select the related articles for each detailed page using a global.
You'd use the link id in the select query. eg...
my @related = $DB->table('New_Table')->select( { LinkID => $link_id }, 'RelatedID' )->fetchall_list;
Then you'd have all the related id's in @related and could just select the records from the Links table and build the output.
my $cond = GT::SQL::Condition->new('ID', 'IN', \@related);
my $sth = $DB->table('Links')->select( $cond );
You'd need a new table as Eliot mentioned and then you can select the related articles for each detailed page using a global.
You'd use the link id in the select query. eg...
my @related = $DB->table('New_Table')->select( { LinkID => $link_id }, 'RelatedID' )->fetchall_list;
Then you'd have all the related id's in @related and could just select the records from the Links table and build the output.
my $cond = GT::SQL::Condition->new('ID', 'IN', \@related);
my $sth = $DB->table('Links')->select( $cond );