asrisbey
asked on
SQL Multiple JOINS to same table
I've got this query:
SELECT View_CMS_Tree_Joined.*, CONTENT_Event.*, act1.*, act2.*
FROM View_CMS_Tree_Joined
INNER JOIN CONTENT_Event
ON View_CMS_Tree_Joined.Docum entForeign KeyValue = CONTENT_Event.[eventID]
LEFT JOIN custom_activity AS act1
ON CONTENT_Event.[EventActivi ty] = act1.[activityID]
LEFT JOIN custom_activity AS act2
ON CONTENT_Event.[EventActivi ty2] = act2.[activityID]
It is returning the correct data - but the field names returned for act1 and act2 are identical - which makes it impossible to distinguish between act1.field1 and act2.field1. I'm obviously doing something wrong here.
Thanks for any help.
SELECT View_CMS_Tree_Joined.*, CONTENT_Event.*, act1.*, act2.*
FROM View_CMS_Tree_Joined
INNER JOIN CONTENT_Event
ON View_CMS_Tree_Joined.Docum
LEFT JOIN custom_activity AS act1
ON CONTENT_Event.[EventActivi
LEFT JOIN custom_activity AS act2
ON CONTENT_Event.[EventActivi
It is returning the correct data - but the field names returned for act1 and act2 are identical - which makes it impossible to distinguish between act1.field1 and act2.field1. I'm obviously doing something wrong here.
Thanks for any help.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER