Does "WHERE... OR" make sense? (1 Viewer)

andreas_udby

Registered User.
Local time
Today, 22:36
Joined
May 7, 2001
Messages
76
I'm not sure if I'm doing this quite right. I want to select everyone in a table who is not a white male. In my SQL statement, can I include the following:

WHERE ([Race_Ethnicity] <> “White” OR [Gender] <> “Male”)

and do I need to encapsulate it differently?

Thanks,
Andreas
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 16:36
Joined
Feb 28, 2001
Messages
27,192
WHERE ([Race_Ethnicity] <> “White” ) OR ( [Gender] <> “Male”)

is a perfectly valid possibility for a WHERE clause.

However, this doesn't do what your English question asked. You wanted all who were not white males.

The above would return no whites of either gender and no males of any ethnicity. Which is a bit more sweeping than your English statement. Maybe you wanted the OR to be AND in this case?

I.e. if you change the OR to AND, then it would be possible to get a black male or a white female in your return set. Is that what you wanted?
 

andreas_udby

Registered User.
Local time
Today, 22:36
Joined
May 7, 2001
Messages
76
Okay, I get it. Yeah, I want everyone who isn't white and everyone who isn't male. If AND is the way to do that, then I'm there.

Thanks for your help!
Andreas
 

Users who are viewing this thread

Top Bottom