rewrite queries as join queries