How to eliminate dupliate records when joining 3 tables and one table has a one to many relationship
table1 <-------> table2
| |
| |
| |
V V
table3
Here is what I've been working with:
SELECT req.component AS file_type,
comp.VALUE AS bbr_file_id,
TO_DATE ('19700101', 'YYYYMMDD')
+ ( (MAX (NVL (request_time, 0))) / 1000 / 60 / 60 / 24)
AS time_sent,
res.number_of_items_received AS total_items,
comp2.VALUE AS cycle_date,
req.job_id AS debug_code
FROM ii_transaction_request req, ii_transaction_component comp, ii_transaction_component comp2, ii_transaction_response res