I have the following query I wrote in MySQL 5.0
Select
eq_employees.empid,
eq_sigreturns.returnid
From
eq_employees
Left Join eq_sigreturns ON eq_employees.empid
=
eq_sigreturns.empid
in (
Select eq_sigreturns.returnid,
eq_sigreturns.empid
From
eq_sigreturns
where
eq_sigreturns.`month` = '12' AND
eq_sigreturns.`year` = '2005'
)
To return all records from the employees table and the returnid from
the sigreturns table where the month and year match.
The query throws an error message, I assume meaning I can't have a
subquery in my join statement. However anywhere else I put the
subquery seems to negate the left join and I only get empids with
matching records in the sigreturns table
Thanks,
Kevin