 select count(*) as count, null as client_id, null as client_unique_id, null as client_nickname, null as client_created, null as client_lastconnected, null as client_totalconnections, null as client_description, null as client_lastip, null as client_login_name, null as homebase_since from clients where server_id=:server_id: and :filter: is not null
 union
 select 0 as count, client_id, client_unique_id, client_nickname, client_created, client_lastconnected, client_totalconnections, client_description, client_lastip, client_login_name, homebase_since from
   (select c.client_id, c.client_unique_id, c.client_nickname, c.client_lastconnected, c.client_totalconnections, c.client_lastip, c.client_login_name, c.homebase_since, a.value as client_created, b.value as client_description from clients as c
   left join client_properties as a on a.server_id = c.server_id and a.id = c.client_id and a.ident = 'client_created'
   left join client_properties as b on b.server_id = c.server_id and b.id = c.client_id and b.ident = 'client_description'
   where c.server_id=:server_id: and :filter: is not null
   order by client_id limit :duration: offset :start:) as limted_clients
 order by count desc, client_id;
