Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Perform an Exception Join in Sybase

Status
Not open for further replies.

sdf73

MIS
Nov 10, 2003
4
GB
Hi all,

I'm relatively new to Sybase, and I was wondering how I perform an 'exception join' command. Normally I would use the following:

Code:
SELECT a.keyid
FROM tableA a
EXCEPTION JOIN
tableB b
ON a.keyid = b.keyid

However when I try using EXCEPTION JOIN in Sybase, the complier returns an error, not recognising EXCEPTION. Instead I have to use SQL like this:

Code:
SELECT a.keyid
FROM tableA 
WHERE a.keyid NOT IN (SELECT b.keyid
                      FROM tableB b
                      WHERE a.keyid = b.keyid 
                      )

This statement, I've found runs a lot slower that the usual EXCEPTION JOIN commmand.

Any ideas on how I can perform an EXCEPTION JOIN in Sybase?

Thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top