Forum Moderators: coopster & phranque

Message Too Old, No Replies

SQL Select Statment Help Needed

With how to select values not equalt to a string

         

Eric_Lander

4:54 pm on Jun 7, 2003 (gmt 0)

10+ Year Member



Hey everyone,

I've tried two ways to select results from a database I've been working with, but no matter what I try to parse out specific results, I cannot run a successful query.

I have tried the following queries:
SELECT * FROM datasource WHERE goodvalue = 'y' AND badvalue <> 'y' GROUP BY 'sku'

And...

SELECT * FROM datasource WHERE goodvalue = 'y' AND badvalue!= 'y' GROUP BY 'sku'

---

In the SELECT statement, I am simply trying to return all records that have the column "goodvalue" equal to "y" and badvalue NOT equal to "y".

Any ideas on what is wrong? I thought that depending upon the system you were using, either "<>" or "!=" would produce the unequal attribute.

Any help would be much appreciated here.

Thanks!

>>> NOTE, there is a space between "badvalue" and "!=", but regardless of how I try to edit this post, the WebmasterWorld system whows otherwise.

jaski

6:27 pm on Jun 7, 2003 (gmt 0)

10+ Year Member



You seem to be doing it right.

What error are you getting?

Eric_Lander

8:34 pm on Jun 7, 2003 (gmt 0)

10+ Year Member



-- Human error. I had a variable mispelled, and when parsed on the page, it showed a mySQL error.

Sorry mods.