Multiple left-outer join results in duplicated rows

grasyWrorma

New Member
I have a big table having Incidents. With this I want to attach values from Incident Attachment and Incident Comments. I have used Left outer join as there may or may not be any comments OR attachment for a Incident.
Now when I use multiple outer join i get duplicated rows.There is a incidentID value that is common for all the tables\[code\]INC1 ATT1 COMMENT1INC1 ATT1 COMMENT2INC1 ATT2 COMMENT1INC1 ATT2 COMMENT2\[/code\]But actually the output should be:\[code\]INC1 ATT1 COMMENT1INC1 ATT2 COMMENT2\[/code\]so that the attachment and the comment values are independent when attaching themselves to the incident table.\[code\]select inc,att.attname,comment.commenttext from inc left outer join att inc.incidentID=att.incidentID left outer join comment inc.incidentID=comment .incidentID\[/code\]Is this possible?
 
Back
Top