title: PostgreSQL, how to append result to another query result
body: <p><strong>First Query</strong></p>
  
  <pre><code>SELECT * FROM users WHERE _id = 1
  </code></pre>
  
  <p>result from query:</p>
  
  <pre><code>{
    username: "Test",
    nickname: "somename"
  }
  </code></pre>
  
  <p><strong>Second Query</strong></p>
  
  <pre><code>SELECT json_object_agg(permission, true) FROM user_permissions WHERE user_id = 1
  </code></pre>
  
  <p>result from query:</p>
  
  <pre><code>{
    add: true,
    delete: true,
    somepermission: true
  }
  </code></pre>
  
  <p><strong>Third Query</strong></p>
  
  <pre><code>SELECT array_agg(number) FROM user_phone_numbers WHERE user_id = 1
  </code></pre>
  
  <p>result from query:</p>
  
  <pre><code>[
    00000-0000-000,
    11111-1111-111
  ]
  </code></pre>
  
  <p>Basically I want to put the result of second and third query into first query so the final result will be</p>
  
  <pre><code>{
    username: "Test",
    nickname: "somename"
    customJSONPermission: {
          add: true,
          delete: true,
          somepermission: true
    },
    customerArrayPhone: [
        00000-0000-000,
        11111-1111-111
    ]
  }
  </code></pre>
  
  <p>How do craft a single SQL command to handle this kind of operation. What kind of keywords or function I should look up?</p>