views:

388

answers:

5

Hi Everyone:

I am wondering if there is some way to do a doesn't equal command in MYSQL. In other words, can you do a command like this: "SELECT * FROM someTitle WHERE someLabel != 'something'"? My code is returning an error when I attempt this.

Thanks for any help!

+2  A: 

Use someLabel <> 'something' instead.

Tinister
+10  A: 

try this

SELECT * FROM someTitle WHERE someLabel <> 'something'
RRUZ
Thanks RRUZ, it works now!
PF1
+5  A: 

Try <> instead of !=

Paul Sasik
+3  A: 

In SQL, like VB, <> is used instead of !=.

You can therefore write the following:

SELECT * FROM someTitle WHERE someLabel <> 'something'

I'm not sure how <> can mean inequality; can anyone explain?

SLaks
Actually, `!=` is ANSI standard.
OMG Ponies
Well, if x is less than y or x is greater than y then x does not equal y.
Eli
+1  A: 

Replace != with <>

Dusty