Hi,

I have a query where I want to retrieve all the people who are not in a specific group. Like so:

    SELECT id, name FROM people WHERE group_id != 3;

Since people may not be in a group at all, I also need to test if the column is NULL:

SELECT id, name FROM people WHERE group_id != 3 OR group_id IS NULL;

Running that through EXPLAIN things look fine, but if I instead use:

    SELECT id, name FROM people WHERE NOT group_id <=> 3;

I get a full table scan. Is that because is <=> equivalent to a function in a sense?

Thanks.



--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/mysql?unsub=arch...@jab.org

Reply via email to