"select a.name, b.department, c.position
from emp a
left join dept b
on a.staffno = b.staffno
left join position c
on a.staffno = c.staffno
where staffno = $staffno";

I know the statement above is totally wrong. I'm just hoping u guys can
understand what i'm trying to achieve from it.

All you have to change to make this right is change the ON statement after
'left join position c' to 'on b.staffno = c.staffno'. Remember that you are
moving from left to right in the join, so your ON must also move from left
to right.



PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to