sub bare_tags
{
my($self)=@_;
- my $sql=("SELECT tags.name FROM tags\n" .
- "WHERE tags.parents_id=''\n" .
- "GROUP BY tags.name\n");
+ my $sql=("SELECT t1.name FROM tags t1\n" .
+ "LEFT JOIN tags t2 on t1.id=t2.parents_id\n" .
+ "WHERE t1.parents_id='' AND t2.id IS NULL\n" .
+ "GROUP BY t1.name\n");
my @names=$self->cmd_firstcol($sql);
return (@names);
}