I have the following table. I need to group by `fromdate`,
and get result with minimum `todate` for each `fromdate`. How can I do it?

```
|------|--------------|--------------|
|  id  |    fromdate  |     todate   | 
|------|--------------|--------------|
| 1    |  2016-03-01  |  2016-01-05  |  
| 2    |  2016-03-01  |  2016-01-11  |  
| 3    |  2016-03-01  |  2016-01-12  | 
| 4    |  2016-03-05  |  2016-01-05  | 
| 5    |  2016-03-05  |  2016-01-11  | 
| 6    |  2016-03-06  |  2016-01-04  | 
| 7    |  2016-03-06  |  2016-01-17  | 
| 8    |  2016-03-06  |  2016-01-19  | 
| 9    |  2016-03-09  |  2016-01-04  | 
|10    |  2016-03-09  |  2016-01-11  | 
|------|--------------|--------------|

```

I have tried this, but it is not giving me the expected result:

```
Select * from test group by fromdate order by fromdate, todate

```