Hi All,
I'm trying to use Excel as a data source and am making the query using MS Query.
The following query worked using SQL Server Management Studio but is not working for Excel:
-------------------------------------------------------
select e1.name
,e1.role
,r1.duty
,d1.conflict
from emp as e1, [role] as r1, conflict as d1
where
e1.[role]=r1.[role] and
r1.duty=d1.duty
and exists (select 1
from emp as e2, [role] as r2, conflict as d2
where
d2.duty=r2.duty and
r2.[role]=e2.[role] and
e2.name=e1.name
and r2.role<>r1.role
and r2.duty<>r1.duty
and r2.duty=d1.conflict
)
order by e1.name
--------------------------------------------------------
Please advice.
Thanks and regards !
Bookmarks