I have the following query I wrote in MySQL 5.0
Select
eq_employees.em pid,
eq_sigreturns.r eturnid
From
eq_employees
Left Join eq_sigreturns ON eq_employees.em pid
=
eq_sigreturns.e mpid
in (
Select eq_sigreturns.r eturnid,
eq_sigreturns.e mpid
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