# ダメ my $sth = $dbh->prepare('SELECT * FROM image_tag WHERE tag IN(?, ?) GROUP BY image HAVING count(image) == ?'); $sth->execute(10, 42, 2); # イイ! my $sth = $dbh->prepare('SELECT * FROM image_tag WHERE tag IN(?, ?) GROUP BY image HAVING count(image) == 2'); $sth->execute(10, 42); なので、 my $rs = $schema->resultset('ImageTag')->search( { tag => {in => [10, 42]} }, { group_by => ['image'], having =>