• If you would post the DDL (CREATE TABLE statement) for the tables involved, some sample data (INSERT INTO statements) that is representative of your problem domain, the expected results based on the sample data I am sure we could provide you with additional assistance.

    Based solely on what you have posted so far, I really couldn't be of much help as I am not really sure what it is you are trying to accomplish.