title: MySQL Use Select on Multiple Conditions on Multiple Columns in a Table
body: <p>I have a database with Name Database1 and Table named table1.The columns in the table are Client Name and Country.I want to search for clients based on a condition using LIKE and want to Exclude in results the Clients from NOT LIKE (NOT IN) Countries.</p>
  
  <pre><code>Client Name,Country
  
  Sandeep,India
  
  Mandeep,USA
  
  John,Japan
  
  Vinay,China
  
  Amit,USA
  
  etc...
  </code></pre>
  
  <p>I tried below stated query.It does give out results but does not filter or exclude the Not Like countries, rather displays all countries.</p>
  
  <pre><code>SELECT CLIENT NAME,
         COUNTRY
  FROM DATABASE1.TABLE1
  WHERE (CLIENT NAME LIKE 'VINAY')
    OR (CLIENT NAME LIKE 'AMIT')
    AND COUNTRY NOT IN ('INDIA',
                        'JAPAN')
  </code></pre>
  
  <p>I have also tried with <code>NOT LIKE</code>:</p>
  
  <pre><code>SELECT CLIENT NAME,
         COUNTRY
  FROM DATABASE1.TABLE1
  WHERE (CLIENT NAME LIKE 'VINAY')
    OR (CLIENT NAME LIKE 'AMIT')
    AND (COUNTRY NAME NOT LIKE 'INDIA')
    AND (COUNTRY NAME NOT LIKE 'JAPAN')
  </code></pre>
  
  <p>Both of above gave results But without filtering-out/excluding India and China in results.Results are appearing for all countries in-spite of using Not LIKE / NOT IN</p>
  
  <p>Any Solution or what is my mistake ?</p>