title: Split a column into three columns using two different characters as separators
body: <p>Using PostgreSQL, I'd like to split the values appearing in one of the columns in my table according to TWO (not one) character. My column <code>id2</code> includes values such as:</p>
  
  <pre><code>chr1:10000485-10006485@NM_022787@NMNAT1
  </code></pre>
  
  <p>I would like to split the column into three columns accordingly (using both, the ":" and the "-" characters as separators:</p>
  
  <pre><code>chr1  |  10000485  | 10006485@NM_022787@NMNAT1
  </code></pre>
  
  <p>Currently my code is:</p>
  
  <pre><code>select split_part(id2, ':', 1)s1,split_part(id2, ':', 2) s2, id2
  from MyTable
  </code></pre>
  
  <p>This outputs as follows (two columns where s1 and s2 are the headers):</p>
  
  <pre><code>s1    |     s2
  chr1  |  10000485-10006485@NM_022787@NMNAT1
  </code></pre>
  
  <p>How can I split <code>id2</code> based on both, ":" AND "-"? 
  can I somehow do sequential split using <code>s2</code>?</p>
  
  <p>I tried using:</p>
  
  <pre><code>select split_part(id2, ':', 1)s1,split_part(id2, ':', 2) s2, split_part(s2, '-', 2)
  </code></pre>
  
  <p>But got the error message: </p>
  
  <blockquote>
  <pre><code>ERROR:  column "s2" does not exist
  LINE 7: ... ':', 1)s1,split_part(id2, ':', 2) s2, split_part(s2, '-', 2...
                                                               ^
  ********** Error **********
  
  ERROR: column "s2" does not exist
  SQL state: 42703
  Character: 160
  </code></pre>
  </blockquote>