mysql> SELECT Symbol FROM gene_info RIGHT JOIN gene2go ON(gene_info.`GeneID`= gene2go.`GeneID`) WHERE GO_Term='proteasome localization'; +-------------+ | Symbol | +-------------+ | SPBC1734.06 | | SPBC646.09c | | cut8 | | rhp6 | | SPAC1420.03 | | SPAC3G6.02 | | rpn5-b | | SPBC19C7.02 | +-------------+ 8 rows in set (2 min 19.11 sec) #### use strict; use Data::Dumper; use Carp; use DBI; my $dsn = 'localhost'; my $user = 'ewijaya'; my $password = 'ewijaya'; my $dbh = DBI->connect('dbi:mysql:motif_finder','monkfan','monkpwd') or die "Connection Error: $DBI::errstr\n"; my $go_term = "proteasome localization"; my $sql = "SELECT Symbol FROM gene_info RIGHT JOIN gene2go ON(gene_info.`GeneID`= gene2go.`GeneID`) WHERE GO_Term=$go_term"; my $sth = $dbh->prepare($sql); $sth->execute or die "SQL Error: $DBI::errstr\n"; while ( my @row = $sth->fetchrow_array ) { print "@row\n"; } #### :!perl search_gene.pl DBD::mysql::st execute failed: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'localization' at line 1 at search_gene.pl line 21. SQL Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'localization' at line 1