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
peterm
  • 91,357
  • 15
  • 148
  • 157
Lena Queen
  • 751
  • 1
  • 10
  • 18
  • 1
    You practically have the query right there. Just fix your quoting issues. – John Conde Dec 16 '13 at 01:55
  • 3
    See http://stackoverflow.com/questions/11321491/when-to-use-single-quotes-double-quotes-and-backticks for quoting examples and in SQL, `<>` is the preferred operator for "not equal to" although `!=` is supported by MySQL. – Michael Berkowski Dec 16 '13 at 02:00

1 Answers1

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'
Eric T
  • 1,026
  • 3
  • 20
  • 42