I have a table showing the count of occurrences of words in a text at certain data points. Here is a simplified example:
Word Chapter Count
dog 1 3
dog 2 7
dog 3 1
cat 2 4
Notice that there is no row for 'cat' in chapters 1 and 3, because the word was not used there.
I need to SELECT INTO a temp table (in prep for other aggregation, etc.) the above data, but I need 'cat' to show up for chapters 1 and 3 with a count of 0. The result should be:
Word Chapter Count
dog 1 3
dog 2 7
dog 3 1
cat 1 0
cat 2 4
cat 3 0
Any tips would be much appreciated. Thanks.