my $sth = $dbh->prepare(q{SELECT name FROM catagories WHERE catagories.workrelated = ('Y' || 'N') ORDER BY name}); $sth->execute();