I would appreciate any suggestions on the following code and why I'm getting the following error message:
Msg 8156, Level 16, State 1, Line 14
The column 'added_by' was specified multiple times for 'A'.
Code
select *
from sfdc..contact C
inner join
(
select * from avenue2..activity G
inner join (
select e.added_by, COUNT(*) as 'TotalActivities'
from avenue2..activity E
where ACTIVITY_DATE between '2008-01-01'
and '2010-12-31'
group by E.added_by
having COUNT(*) > 0
)
B on G.ADDED_BY = B.ADDED_BY
where G.Activity_Date between '2008-01-01' and '2010-12-31'
)
A on C.retire_stamp2__C = A.Contact_stamp2
where A.date_added between '2010-01-02' and '2010-01-31'
Msg 8156, Level 16, State 1, Line 14
The column 'added_by' was specified multiple times for 'A'.
Code
select *
from sfdc..contact C
inner join
(
select * from avenue2..activity G
inner join (
select e.added_by, COUNT(*) as 'TotalActivities'
from avenue2..activity E
where ACTIVITY_DATE between '2008-01-01'
and '2010-12-31'
group by E.added_by
having COUNT(*) > 0
)
B on G.ADDED_BY = B.ADDED_BY
where G.Activity_Date between '2008-01-01' and '2010-12-31'
)
A on C.retire_stamp2__C = A.Contact_stamp2
where A.date_added between '2010-01-02' and '2010-01-31'