my $sth = $dbh->prepare(qq{ select tbl.column1 , tbl2.column2 from tbl1 join tbl2 on tbl1.tbl2_id = tbl2.id where condition = ? and condition2 = ? }) or die "Can't prepare query: $DBI::errstr";