Non Equi Join

  • Thread starter Thread starter C. Houk
  • Start date Start date
C

C. Houk

Anyone know of a resource to learn how to use Non Equi
Join queries. I was told I should try to use one for a
problem I am having.

(e-mail address removed)
 
C. Houk said:
Anyone know of a resource to learn how to use Non Equi
Join queries. I was told I should try to use one for a
problem I am having.

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I'm assuming your informant meant something like this:

SELECT *
FROM Table1 As T1 INNER JOIN Table2 As T2 ON T1.ID <> T2.ID

The non-equal ("non-equi") is

T1.ID <> T2.ID

instead of

T1.ID = T2.ID

IOW, the not equal sign (<>) instead of the equal sign (=).

Other comparisons are:
= Greater than or equal to
Greater than
<= Less than or equal to
< Less than

The most common is the equal comparison.

I've found that anything other than the equal comparison tend to run
slower than equal comparisons.

You can learn about JOIN queries in any reputable data design/SQL book.

--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBQHH/NYechKqOuFEgEQLmlQCfXd3HzRHPiTNK5Q8r/JeyrKOto2cAoNv7
Gu1/0aZm4YJyn9loQ8CTJAuv
=zIsH
-----END PGP SIGNATURE-----
 
Anyone know of a resource to learn how to use Non Equi
Join queries. I was told I should try to use one for a
problem I am having.

"SQL For Smarties" by Joe Celko, "SQL For Mere Mortals" by Mike
Hernandez would cover the subject.

If you'ld repost the problem using your actual table and field names,
someone should be able to help right here; but either or both books
would be useful references!
 
Back
Top