title: MySql select all tables with multiple specific columns
body: <p>I want to get all table names which has 3 specific columns.</p>
  
  <p>What I want is from information schema I want to get <strong>all table names</strong> which contains <code>columnA</code> <strong>AND</strong> <code>columnB</code> <strong>AND</strong> <code>columnC</code>.</p>
  
  <p>Currently I am using a query like</p>
  
  <pre><code>SELECT DISTINCT TABLE_NAME 
    FROM INFORMATION_SCHEMA.COLUMNS
      WHERE COLUMN_NAME='columnA'
          AND TABLE_SCHEMA='mysampledatabase';
  </code></pre>
  
  <p>How can I <strong>extend the above query</strong> and select tables which contains column names <code>columnA</code> and  <code>columnB</code> ?</p>
  
  <p><br></p>
  
  <hr>
  
  <p>I came across <a href="https://stackoverflow.com/questions/193780/how-to-find-all-the-tables-in-mysql-with-specific-column-names-in-them">this answer</a> and other similar answers. They have answered following:</p>
  
  <blockquote>
    <p><code>SELECT DISTINCT TABLE_NAME 
        FROM INFORMATION_SCHEMA.COLUMNS
        WHERE COLUMN_NAME IN ('columnA','ColumnB')
            AND TABLE_SCHEMA='YourDatabase';</code></p>
  </blockquote>
  
  <p>However what they select any table which has either of the 3 columns. I believe that is because of <code>WHERE COLUMN_NAME IN ('columnA','ColumnB','ColumnC')</code> which , i believe, is equivalent to <code>COLUMN_NAME = 'columnA' OR COLUMN_NAME = 'columnB' OR COLUMN_NAME = 'columnC'</code></p>
  
  <p><br></p>
  
  <hr>
  
  <p>I have tried to replace the WHERE clause with <code>WHERE COLUMN_NAME='columnA' AND COLUMN_NAME='columnB' AND COLUMN_NAME='columnC'</code> which obviously doesn't return any results because <code>COLUMN_NAME</code> can only be 1 value at a time!</p>