11

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!

1
  • 1
    WHERE somelabel != 'something' works fine for me on MySQL 4.1 - what is the error? Commented Nov 2, 2009 at 2:45

5 Answers 5

24

try this

SELECT * FROM someTitle WHERE someLabel <> 'something'
Sign up to request clarification or add additional context in comments.

Comments

7

Try <> instead of !=

Comments

5

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?

2 Comments

Actually, != is ANSI standard.
Well, if x is less than y or x is greater than y then x does not equal y.
4

Use someLabel <> 'something' instead.

Comments

2

Replace != with <>

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.