eobiki10
SSCrazy
Points: 2390
More actions
December 8, 2013 at 7:10 am
#285752
Hi All,
Can someone help me to re-write this query to use one single coordinators table.
SELECT *
FROM personnel
WHERE Office IN ( SELECT Office_code
FROM coordinators
WHERE employee IN (
SELECT employee ID
FROM coordinators)
)
EO
palotaiarpad
SSCertifiable
Points: 5617
December 8, 2013 at 7:56 am
#1671754
SELECT
p.*
FROM
personnel p inner join
coordinators c on p.Office=c.Office_code
As you are seeking an employee of the coordinators table between all employees in the coordinators table, the second IN clause is not needed at all.
raut.nilesh
SSC Rookie
Points: 25
December 9, 2013 at 6:47 am
#1671917
:-)SELECT P.*
FROM personnel P inner join coordinators C on
p.Office=c.Office_code
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply