my $sth = $dbh->prepare('SELECT DISTINCT email FROM contacts WHERE guest = ? ORDER BY email'); $sth->execute($value) or die $sth->errstr;