Something like:
my $rand = int ( rand ( $DB->table('Links')->count ) );
my @bad = qw/Adult/;
my $cond = GT::SQL::Condition( 'Category.Name', 'NOT IN', \@bad, 'Links.ID', '=', $rand );
my $link = $DB->table('Links','Category')->select($cond)->fetchrow_hashref;
Code:
require GT::SQL::Condition; my $rand = int ( rand ( $DB->table('Links')->count ) );
my @bad = qw/Adult/;
my $cond = GT::SQL::Condition( 'Category.Name', 'NOT IN', \@bad, 'Links.ID', '=', $rand );
my $link = $DB->table('Links','Category')->select($cond)->fetchrow_hashref;