Question: I have a database created using Ruby-on-Rails. What I require is a model (perhaps) where I can input some information in a form and then press a button that sends emails to all the users registered in the database. The email contains the details written in the form. Is that possible? Any help will be very appreciated.

Mike

Answer: 
The `is null` check only works for `colors` that have no matching `membercolor` at all.

If any `membercolor` matches, you end up with a result set like:

```
color blue memberid 8
color blue memberid 9
color blue memberid 10

```

Applying the `where` clause filters out all blue rows:

```
memberid IS NULL OR b.memberid=11

```

If no `membercolor` matches, the result set looks like:

```
color blue memberid NULL

```

The `where` clause will allow this to pass.
It was always this way (since 2000 at least) - to see why, check this other statement:

```
SELECT * FROM color a LEFT JOIN membercolor b 
    ON a.colorid=b.colorid 

```

On the other hand, what you might have intended is: 

```
SELECT * FROM color a LEFT JOIN membercolor b 
    ON a.colorid=b.colorid AND b.memberid=11 WHERE b.memberid IS NULL OR b.memberid=11

```