title: Get a SQL query hash without (ignoring) parameters
body: <p>I have tons of queries and wanna count their occurrence.</p>
  <p><strong>Problem</strong>: the same query can have different parameters.</p>
  <p>I thought about using <code>EXPLAIN</code> and then hash the array.
  But i guess that wont work well.</p>
  <p>Is there any way to get a hash of a query without including the params and &quot;style&quot; <em>(format?)</em>?<br />
  <em>F.e. can the mysql (mariadb) server return a prepared statement from a query?</em><br />
  <em>(EDIT: i do not have the prepared statements from code. I got SQL strings only.)</em></p>
  <p>Simple example:<br />
  <code>SELECT * FROM foo where bar = 'baz</code><br />
  <code>SELECT * FROM `foo` WHERE `bar` = 'baz';</code><br />
  <code>SELECT * FROM `foo` WHERE `bar` = 3</code><br />
  <code>SELECT * FROM `foo` WHERE `bar` = 3;</code><br />
  ...<br />
  This is the same query with different &quot;style&quot; and different parameters.<br />
  What i would like to count up is the occurrence of <code>SELECT * FROM `foo` WHERE `bar` = {.*};</code></p>
  <p><em>Note: the queries will contain multiple joins, subqueries, ect.</em></p>
  <hr />
  <p>In this case I got those SQL queries from a <code>general_log</code> table.
  No code, just SQL strings.
  It's <em>not</em> a question of &quot;how can I do this better&quot;.
  It's a &quot;how can I get a better result from what I got&quot;.</p>