title: MySQL select first 5 rows (multiple rows)
body: <p>I need to select multiple rows in MySQL. I have procedure called 'proc_table' which returns me now 3 fields - oid, objet, and 1 row from db.cars. Query is limited (by me).</p>
  <p>I need to delete that limit and make query which ll return me first 5 rows. If they don't exist there will be no reference (field with null value). I make some query in 'pseudo code'.</p>
  <p><strong>Q: What function in MySQL I should use to select specific rows? How deal with situation if they don't exist?</strong></p>
  <pre><code>CREATE procedure `proc_table`() 
  BEGIN
      SELECT a.oid as 'oid', 
      a.objet as 'objet', 
  
  
  -- limited query
          (select tab2_oid from db.cars where tab1_oid = a.oid LIMIT 1)
  -- limited query
  
      FROM db.tab1 as a;
  END$$
  </code></pre>
  <h1>pseudo code</h1>
  <pre><code>-- limited query
          (select tab2_oid as 'first_row' from db.cars where tab1_oid = a.oid where row=1)
          (select tab2_oid as 'second_row' from db.cars where tab1_oid = a.oid where row=2)
  ... 
  
  -- limited query
  </code></pre>