title: Extract HTML text using Mysql
body: <p>I am stuck in a situation where I have a field in mysql which is a long html field. I need to extract  the words between html tags. </p>
  
  <p>Say, </p>
  
  <p><code>&lt;!DOCTYPE html&gt;&lt;html&gt;&lt;body&gt;&lt;h1&gt;My First Heading&lt;/h1&gt;&lt;p&gt;My first paragraph.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</code></p>
  
  <p>I need something like this. </p>
  
  <pre><code>"My First Heading My first paragraph"
  </code></pre>
  
  <p>I am currently doing it in java from an exported csv file using a function like that of the following: </p>
  
  <pre><code>public String getStringFromHtml(String html) {
           String nohtml = html.toString().replaceAll("&lt;[^&gt;]*&gt;"," ");
           return nohtml.trim().replaceAll("\\s+", " ");
  }
  </code></pre>
  
  <p>But lets assume that I am just using Mysql workbench (no server side scripts) for some data analysis.</p>
  
  <p>I was still wondering whether there are any ways that Mysql allow us to eliminate the html tags and extract the words in between. I tried to search all over stack overflow &amp; google, I was not lucky as there is only advice to use it in PHP or java or stored procedures. </p>
  
  <p>Still there is no way to extract html text using SQL ? </p>