I want to run a query on `MySql version 5.1.9` that returns me only top two (order by JoiningDate) of selected Dept.

For example, my data is like:

```
+-------+------------------------------------------+----------+------------+
| empid | title                                    | Dept     | JoiningDate|
+-------+------------------------------------------+----------+------------+
|   1   | Research and Development                 | 1        | 2015-08-06 |
|   2   | Consultant                               | 2        | 2015-08-06 |
|   3   | Medical Consultant                       | 3        | 2015-08-06 |
|   4   | Officer                                  | 4        | 2015-08-06 |
|   5   | English Translator                       | 5        | 2015-08-06 |
|   6   | Teacher                                  | 1        | 2015-08-01 |
|   7   | Physical Education                       | 2        | 2015-08-01 |
|   8   | Accountant                               | 3        | 2015-08-01 |
|   9   | Science Teacher                          | 4        | 2015-08-01 |
|  10   | Home Science                             | 5        | 2015-08-01 |
|  11   | Research Assistant                       | 1        | 2015-08-05 |
|  12   | Consultant                               | 2        | 2015-08-05 |
|  13   | Consultant HR                            | 3        | 2015-08-05 |
|  14   | Technical Lead                           | 4        | 2015-08-05 |
|  15   | Hindi Translator                         | 5        | 2015-08-05 |
|  16   | Urdu Teacher                             | 1        | 2015-08-02 |
|  17   | Physical Education                       | 2        | 2015-08-02 |
|  18   | Accountant                               | 3        | 2015-08-02 |
|  19   | Science                                  | 4        | 2015-08-02 |
|  20   | Home Science                             | 5        | 2015-08-02 |
+-------+------------------------------------------+----------+------------+

```

I want the query to output the latest joined two empid's of Dept (1,2,3) i.e:

```
+-------+------------------------------------------+----------+------------+
| empid | title                                    | Dept     | JoiningDate|
+-------+------------------------------------------+----------+------------+
|   1   | Research and Development                 | 1        | 2015-08-06 |
|  11   | Research Assistant                       | 1        | 2015-08-05 |
|   2   | Consultant                               | 2        | 2015-08-06 |
|  12   | Consultant                               | 2        | 2015-08-05 |
|   3   | Medical Consultant                       | 3        | 2015-08-06 |
|  13   | Consultant HR                            | 3        | 2015-08-05 |
+-------+------------------------------------------+----------+------------+

```