I am trying to select a set of data including female and male in 50 states. However, I need to exclude 5 states with both female and male, and one state with female. I'm not sure how to have two conditions in one where statement.
Below is the simple version of the code. The last row of the code is clearly wrong.
I want to say 'I want to exclude data when state code is OR, CA, WA, OH and VA', also 'I want to exclude data when state code is DC and gender is female'.
I hope you can understand what I am trying to ask. Any advice would be greatly appreciated. Thank you!
SELECT * FROM dataset WHERE state_code NOT IN ('OR','CA','WA','OH','VA) AND (state_code <> DC AND gender <> female)