title: postgresql: double split data into several columns with subquery
body: <p>I have this code</p>
  
  <pre><code>SELECT 
  split_part(oc.created_by, '/', 1) as created_by,
  split_part(oc.created_by, '/', 2) as app_version,
  split_part(
      (SELECT split_part(oc.created_by, '/', 3) 
      FROM consultations oc), ' ', 1) as os_type,
  split_part(
      (SELECT split_part(oc.created_by, '/', 3)
          FROM consultations oc), ' ', 2) as os_version 
  FROM consultations oc
  </code></pre>
  
  <p>but I always get</p>
  
  <blockquote>
    <p>[Err] ERROR:  Invalid Query:  DETAIL:</p>
    
    <hr>
    
    <p>error:  Invalid Query:     code:      8001</p>
    
    <p>context:   single-row subquery returns more than one row</p>
    
    <p>query:     30621434    location:  0.cpp:87</p>
    
    <p>process:   padbmaster [pid=27771]</p>
    
    <hr>
  </blockquote>
  
  <p>can anyone help me to remove that ? </p>
  
  <blockquote>
    <p>single-row subquery returns more than one row</p>
  </blockquote>
  
  <p>thank you</p>