my $sth = $dbh->prepare(q{ SELECT x, y, z FROM table1, table2 WHERE x = ?, y = ? ORDER BY z });