select
`client`.`id`,
sum(`order`.`price`)
from `order`
join `client` on `order`.`client_id` = `client`.`client_id`
where `order`.`datetime` between "2014-10-01 00:00:00" and "2014-10-31 23:59:59"
group by `client`.`id`
having count(`order`.`id`) > 2
var max_width = $(window).width();
if ($('#rotator').width() < max_width) {
$('rotator').width(max_width);
}