Ankit  Shukla

Ankit Shukla

  • NA
  • 681
  • 116.4k

Reason of output

Feb 3 2017 6:02 AM
table runners
 
| id    | name |
| 1     | John Doe |
| 2     | Jane Doe |
| 3     | Alice Jones |
| 4     | Bobby Louis |
| 5     | Lisa Romero |
 table races
| id    | event                     | winner_id |
| 1     | 100 meter dash   | 2 |
| 2     | 500 meter dash   | 3 |
| 3     | crosscountry         | 2 |
| 4     | triathalon               | NULL |
Output of the query below?
SELECT * FROM runners WHERE id NOT IN (SELECT winner_id FROM races)
 
"Their is no row selected due to 'null' in races table" Please explain the reason of this.
 
Thanks in advance. 

Answers (2)