$ 0 0 you should be able to accomplish this with some group by statements, left outer joins and a couple of <> conditions