title: Knex/SQL: Merge one to many join in one object
body: <p>I got two tables: 'page' and 'page_css'. I want a one to many relationship between page and page_css (one page contains multiple page_css).
  See table structure: </p>
  
  <p>Page table structure:
  <a href="https://i.stack.imgur.com/qoLGW.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/qoLGW.png" alt="page table structure"></a></p>
  
  <p>Page_css table structure:
  <a href="https://i.stack.imgur.com/jqNiu.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/jqNiu.png" alt="page_csss_table_structure"></a></p>
  
  <p>This is the Knex query I am using:</p>
  
  <pre class="lang-js prettyprint-override"><code>var page = knex('page')
    .where({ slug: req.params.slug })
    .join('page_css', { 'page_css.page_id': 'page.id' })
    .then(function(page) {
      if (page) {
        return res.json(page);
      }
      return res.send('page not found');
    });
  </code></pre>
  
  <p>This the result I'm getting:</p>
  
  <p><a href="https://i.stack.imgur.com/Nrnh5.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Nrnh5.png" alt="enter image description here"></a></p>
  
  <p>But I want the result like this:</p>
  
  <p><a href="https://i.stack.imgur.com/NfaVY.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/NfaVY.png" alt="enter image description here"></a></p>
  
  <p>What SQL/Knex query do I need to run to get it like the format above?</p>