Results 1 to 2 of 2

Thread: SQL Anywhere

  1. #1
    Join Date
    Jun 2005
    Posts
    11

    SQL Anywhere

    Can a query which includes a NOT EXISTS subquery be rewritten with a join?

    Many thanks.

  2. #2
    Join Date
    Nov 2002
    Location
    DE
    Posts
    246
    With a left outer join it should work. I do not know the exact syntac in SQl Anywhere, but in T-SQL it would look like this (assuming that TableA contains the records to display, and TableB the records you want to exclude.

    SELECT A.*
    FROM TableA As A
    LEFT OUTER JOIN TableB As B ON A.keyfild = B.keyfield
    WHERE b.keyfield IS NULL

Posting Permissions

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