Jump to content

WHERE Clause Confusion


monkeytooth

Recommended Posts

Im trying to build a count for something, and the count works as I would want it to minus one bit. I want the count to exclude specific rows with certain strings in the columns lets say for the sake of easy example..

 

I have 3 columns, hundreds of rows.. I am grouping my count with the first of 3 columns. The other 2 columns can be just about anything its a varchar column (both). However, there are certain hardcoded defaults I want to exclude from the count if they exist, as they are starter values, person hasn't activated there account or whatever the case may be. So I know in php I can do something like

 

if('thisCol' !== "enter"){count}
elseif('thisCol' !== "start"){count}
elseif('thisCol2' !== "zero"){count}
else{skip}

(poor example but you get the idea)

 

Is that something possible to do with a query? I know I can refine my queries WHERE eh="one" AND eh="two" OR fg="three"

 

but what about the opposite of that idea? Plausible? How?

Link to comment
https://forums.phpfreaks.com/topic/219182-where-clause-confusion/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.