Iterated resultset, inner join 3 tables