title: Get column index using column name mySql
body: <p>I need a query that will give me the name and location (index of the column) of <code>PRIMARY KEY</code> 
  in different tables.</p>
  
  <p>I can find the name of the <code>PRIMARY KEY</code> column using:</p>
  
  <pre><code>SELECT `COLUMN_NAME`FROM `information_schema`.`COLUMNS`WHERE 
      (`TABLE_SCHEMA` = 'dbName') AND (`TABLE_NAME` = 'tableName') 
      AND (`COLUMN_KEY` = 'PRI');
  </code></pre>
  
  <p>How do I get it's column position by that name or by another method? </p>