drop primary key if exists
<p>I need a query that could drop primary key only if it exists.</p>

<pre><code>ALTER TABLE tablename DROP PRIMARY KEY;
</code></pre>

<p>This will return error if it does not exists, but my requirement is to run a query in different databases.</p>