title: Get table data with vertical limit mysql
body: <p>i need a help in get data using vertical limit with mysql query</p>
  
  <p>this is my example table</p>
  
  <pre><code> -----------------
  | id | pid | text |
   -----------------
  |  1 |   1 | abc  |
  |  2 |   2 | def  |
  |  3 |   3 | ghi  |
  |  4 |   1 | jkl  |
  |  5 |   2 | mno  |
  |  6 |   4 | pqr  |
  |  8 |   2 |  vw  |
  |  9 |   1 | xyz  |
  | 10 |   3 | stu  |
  | 11 |   5 | xyz  |
  | 12 |   6 | stu  |
   -----------------
  </code></pre>
  
  <p>how can i get data with limit 2 data in every pid in one query</p>
  
  <p>for example table the result that i want to get is like below</p>
  
  <pre><code> -----------------
  | id | pid | text |
   -----------------
  |  1 |   1 | abc  |
  |  4 |   1 | jkl  |
  |  2 |   2 | def  |
  |  5 |   2 | mno  |
  |  3 |   3 | ghi  |
  | 10 |   3 | stu  |
  |  6 |   4 | pqr  |
  | 11 |   5 | xyz  |
  | 12 |   6 | stu  |
   -----------------
  </code></pre>
  
  <p>can i do that??
  i try explore to found the query but not found </p>
  
  <p>thanks</p>