SELECT specific characters from column SQL
<p>I have column name <code>BOOKNAME</code> in <code>BOOKS</code> table which can contain many special characters apart from alphanumeric e.g. <code>',$#()[],</code></p>

<p>How can I write a query to show me only special characters in ALL rows and union them e.g. </p>

<pre><code>Row number Book name   
1           Alice$inWonder(Land)
2           Tom Harry#$%^&amp; adventures
</code></pre>

<p>So the query should show output like <code>$()#%^&amp;</code></p>

<p>I tried this but cannot see why it does not show only these characters</p>

<pre><code>SELECT replace(BOOKNAME , '%[^a-zA-Z0-9 ]%', '') FROM BOOKS 
WHERE BOOKNAME like '%[^a-zA-Z0-9 ]%'
</code></pre>