Please refer to this [sqlfiddle](http://sqlfiddle.com/#!2/4a9c0/4). In that table, there is missing data from `2014-09-21` to `2014-09-30`.

The second sql is what I wanted. If there are no differences between allotments the result is ok. But with the difference, I want `0` as the output. Coz there are dates that not having allotments.

Please help me to solve this.

Thanks.