title: Combine multiple SQL queries with having limit
body: <p>This is my table </p>
  
  <p><a href="https://www.db-fiddle.com/f/7srXHcJaNt8XRx5UGSVZxY/0" rel="nofollow noreferrer"><strong>DB -Fiddle Link</strong></a> Also a <strong><a href="http://www.sqlfiddle.com/#!9/a9621/1" rel="nofollow noreferrer">SQL FIDDLE</a></strong> LINK</p>
  
  <pre><code>`id`, `pname`, `comapny_id`, `premium`
  (1, 'aaaa', 1, '1'),
  (2, 'bbbb', 1, '2'),
  (3, 'cccc', 1, '3'),
  (4, 'dddd', 1, '2'),
  (5, 'eeee', 1, '1'),
  (6, 'ffff', 1, '3'),
  (7, 'gggg', 1, '3'),
  (8, 'hhhh', 1, '2'),
  (9, 'iiii', 1, '1'),
  (10, 'jjjj', 1, '2');
  </code></pre>
  
  <p>I want to combine 3 queries.</p>
  
  <p>I tried </p>
  
  <pre><code>SELECT *
  FROM query_test 
  WHERE company_id = 1 AND premium = 1 
  LIMIT 3 
  INNER JOIN query_test ON SELECT * FROM query_test WHERE company_id = 1 AND premium = 2 LIMIT 4;
  </code></pre>
  
  <p>But that does not work for me. How can I join the following three queries using <a href="https://www.w3schools.com/sql/trysql.asp?filename=trysql_select_join" rel="nofollow noreferrer">SQL join</a>? I am learning SQL join from W3Schools.</p>
  
  <p>Query #1:</p>
  
  <pre><code>SELECT * 
  FROM query_test 
  WHERE company_id = 1 AND premium = 1 
  LIMIT 3
  </code></pre>
  
  <p>Query #2:</p>
  
  <pre><code>SELECT * 
  FROM query_test 
  WHERE company_id = 1 AND premium = 2 
  LIMIT 4
  </code></pre>
  
  <p>Query #3:</p>
  
  <pre><code>SELECT * 
  FROM query_test 
  WHERE company_id = 1 AND premium = 3 
  LIMIT 3
  </code></pre>
  
  <p>How can I achieve that with minimum time consumption?</p>
  
  <p>Help should be appreciated. </p>
  
  <p>Gracias de antemano.</p>