>I have a problem adapting a multiple select to MySQL.
>Can someone help me ?
>
>Here is my request (Oracle format)
>
>SELECT Tactic.teamCode FROM Tactic WHERE
>Tactic.teamCode NOT IN (SELECT Game.teamCode1 FROM Game, Turn WHERE
>Game.gameTurn = Turn.code)
>AND Tactic.teamCode NOT IN (SELECT Game.teamCode2 FROM Game, Turn WHERE
>Game.gameTurn = Turn.code);
>
>I could use the following one, if it's easier to translate to MySQL
>SELECT Tactic.teamCode FROM Tactic WHERE
>Tactic.teamCode NOT IN (SELECT Game.teamCode1 FROM Game, Turn WHERE
>Game.gameTurn = 3)
>AND Tactic.teamCode NOT IN (SELECT Game.teamCode2 FROM Game, Turn WHERE
>Game.gameTurn = 3);
>
>Thanks
>
>Cedric Lefebvre

    SELECT Tactic.teamCode
    FROM (Tactic tc LEFT JOIN Game g
            ON (tc.teamCode = g.teamCode1) OR (tc.teamCode = g.teamCode2))
         LEFT JOIN Turn tn ON g.gameTurn = tn.code
    WHERE (g.teamCode1 IS NULL) AND (g.teamCode2 IS NULL);

Know thyself? Absurd direction!
Bubbles bear no introspection.     -Khushhal Khan Khatak
MySQL list magic words: sql query database

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to