in reply to Re: SQL JOINs vs WHERE statements
in thread SQL JOINs vs WHERE statements

Would you be able to do that with a WHERE clause instead of a JOIN?

SELECT stf.StaffId, stf.StaffName, stf.Position, stf.ManagerId, mgr.StaffName AS ManagerName, mgr.Position AS ManagerPosition FROM staff AS stf, staff AS mgr where stf.ManagerId=mgr.StaffId

I think... :-)


---
demerphq

<Elian> And I do take a kind of perverse pleasure in having an OO assembly language...

Replies are listed 'Best First'.
Re: Re: Re: SQL JOINs vs WHERE statements
by CountZero (Bishop) on Aug 19, 2003 at 20:59 UTC

    (Warning: possible duplicate posting)

    Yes indeed, but the "comma" is really only a join in disguise:

    INNER JOIN and , (comma) are semantically equivalent. Both do a full join between the tables used. Normally, you specify how the tables should be linked in the WHERE condition. MySQL manual

    CountZero

    "If you have four groups working on a compiler, you'll get a 4-pass compiler." - Conway's Law