How to split value using underscore (_) and period (.)?
<p>I have a table with strings:</p>

<pre><code>Orig_Value
-----------
Abc_abc_1.2.3
PQRST.abc_1
XY.143_z
</code></pre>

<p>I want to split this using <code>_</code> and <code>.</code> with the desired output:</p>

<pre><code>Original_Value    Col1    Col2   Col3   Col4   Col5
-------------     ----    ----   ----   ----   ----
Abc_abc_1.2.3     Abc      abc     1      2     3
PQRST.abc_1       PQRST    abc     1
XY.143_z          XY       143     z
</code></pre>

<p>Query for MSSql and MySQL or PostgreSQL will do.</p>

<p>I tried using substring function like below query, but its not applicable in all data I have:</p>

<p><img src="https://i.stack.imgur.com/CrjK4.jpg" alt="code"></p>