title: Add a column to result, which is another SELECT with dependency
body: <p>This one is a little bit tricky, at least to me to explain, so please, don't get mad if you don't get the point - it's likely caused by my poor explanation.</p>
  
  <p>I want to get one more column from my main SELECT, which will represent number of rows from another table, suiting id of main record.</p>
  
  <p>So, imagine main table, which I am selecting from. I'll call it simply <strong>main</strong>.</p>
  
  <p>What I want to select from <strong>main</strong>, basically is:</p>
  
  <pre><code>SELECT * FROM main ORDER BY c1 ASC LIMIT 5
  </code></pre>
  
  <p>Plus I need one extra column for each row returned, which says number of rows from <strong>side</strong> table, matching the id:</p>
  
  <pre><code>SELECT COUNT(*) FROM side WHERE m_id = main_id
  </code></pre>
  
  <p>Maybe an example will tell you a little bit more</p>
  
  <pre><code>      id   data1   data2           id   m_id   ...
  main ----|-------|-------   side -----|------|-----
         1     aa     ab              1     1     
         2     xx     yy              2     2
         3     az     bz              3     1
                                      4     1
                                      5     3
                                      6     2
                                      7     1
                                      8     1
                                      9     2
  
  expected result:
   id   data1   data2    num
  ----|-------|-------|------
    1     aa      ab      5
    2     xx      yy      3
    3     az      bz      1
  </code></pre>