RIGHT OUTER JOIN example

Another simple query. I have a list of vocabulary words with their definitions. I found a usage that clearly expressed the meaning of the word and put it in a different table. When I was nearly done I wanted to make sure that all of the words had at least one usage example. This is the code that does it.


SELECT words.word, words_usage.word
FROM words_usage 
RIGHT OUTER JOIN words 
ON words_usage.word = words.word 
WHERE words_usage.word IS NULL 
ORDER BY `words_usage`.`word` ASC

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.