Results 1 to 3 of 3

Thread: Not Exists -- ?

  1. #1
    Join Date
    Jun 2004
    Posts
    6

    Unanswered: Not Exists -- ?

    SELECT t1.f1 from t1 where not exists (select t2.f1 from t2)

    How rewrite the above query without 'exist' or 'in'? In the other word, use only 'Inner' and 'Outer join' because MySQL version does not recognize 'exists' and 'in'?

    thanks;

  2. #2
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    You have to do it "the hard way" when the tool won't support subqueries:
    Code:
    SELECT t1.f1
       FROM t1
       LEFT OUTER JOIN t2
          ON (t2.f1 = t1.f1)
       WHERE  t2.f1 IS NULL;
    -PatP

  3. #3
    Join Date
    Jun 2004
    Posts
    6

    thanks;

    Thanks, Pat.

    Shawn

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •