Thank you r937 for your answer, the select statement were just an example.
I realized that my MySQL was an old version, 4.0! I were sure that it was 4.1, but a check turned out that it was 4.0.
Now I'm running the latest version.
I tried the Northwind database, although that is MSSQL Server, but just use the sample data in Query Analyser, but the principal is the same.
1)SELECT * FROM Customers
It returns 91 rows.
1)SELECT * FROM Customers c
WHERE EXISTS (SELECT * FROM Orders o where o.customerid = c.customerid)
It returns 89 rows.
Just don't know why ?
The subquery should always returns TRUE, why there are 2 less?
This should be a kind of correlated query, so the outer query processes the outer table row by row, and the row is then referenced in the subquery in this loop. It should only returns the rows in the outer table when the row referenced in the subquery match the condition ?