Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.