You're not giving enough information.
We would be happy to help but we need you to be more explicit on what you need.
Please post the DDL for your tables and sample data in the form of INSERT statements, as well as the expected results based on that sample data.