0

How to get mysql data with ignore some value? The logic :

SELECT name,country 
 FROM person 
WHERE name!=jonathan and name!=fedrick and country!=italy
2
  • 1
    You practically have the query right there. Just fix your quoting issues. Commented Dec 16, 2013 at 1:55
  • 3
    See stackoverflow.com/questions/11321491/… for quoting examples and in SQL, <> is the preferred operator for "not equal to" although != is supported by MySQL. Commented Dec 16, 2013 at 2:00

1 Answer 1

2

As John Conde comment, you just need the quotes. You probably need quotes for string while integer can go without quotes.

SELECT name,country FROM person WHERE name!='jonathan' and name!='fedrick' and country!='italy'
Sign up to request clarification or add additional context in comments.

1 Comment

You have a quote out-of-place, see name!='fedrick and'

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.