I'm afraid I don't understand. From your first message, it appears you want a list of rows from table1 whose ids do not appear in table2. The query Egor sent you does just that. Did you try it? If, as you say here, that isn't what you want, could you please describe what you do want?


Michael

[EMAIL PROTECTED] wrote:

Thanks your help, but I would like to do the following:

If I have is ONE same ID between the two tables, than the result it must be "empty".

Egor Egorov <[EMAIL PROTECTED]>

[EMAIL PROTECTED] wrote:
<snip>

I have a query problem. I want to make a query....

SELECT    *
FROM table1
INNER JOIN table2 ON table1.id NOT IN table2.id

But I can't use the "NOT IN" expression here.

What can i do?

I have the MySQL version 4.x I can't use subquery :(


If I've got you right you need LEFT JOIN instead of INNER JOIN.


SELECT * FROM table1 LEFT JOIN table2
                 ON table1.id=table2.id
                 WHERE table2.id IS NULL;



-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]



Reply via email to