List:MySQL on Win32« Previous MessageNext Message »
From:John Bonnett Date:September 28 2009 11:21am
Subject:RE: strange behavior of SELECT
View as plain text  
That's what it is supposed to do. It should produce every pair of rows,
one from each table, where the two field1s do not match. As you have
seen there are rather a lot of possible pairs! You don't typically use a
query like that very often unless you have more conditions in the WHERE
clause.

John Bonnett

-----Original Message-----
From: ROMEO PETRUCA [mailto:rpetruca@stripped] 
Sent: Monday, 28 September 2009 8:07 PM
To: win32@stripped
Subject: strange behavior of SELECT

Hi !

i hahe two tables same structure both, and first 2000 records, second
1500 records. primary key is set to field1

first query:

select * from table1,table2 where table1.field1=table2.field1

works fine the result is ok.

but this query work strange:

select * from table1,table2 where table1.field1<>table2.field1

and give me about 350.000 records





      

Thread
strange behavior of SELECTROMEO PETRUCA28 Sep
  • RE: strange behavior of SELECTJohn Bonnett28 Sep