$query="select result.id, result.workunitid, result.appid, result.hostid, result.claimed_credit, result.app_version_id, result.elapsed_time, result.flops_estimate, result.cpu_time, workunit.rsc_fpops_est from result, workunit where workunit.id = result.workunitid and result.validate_state=1 and claimed_credit > $min_claimed_credit and claimed_credit < $max_claimed_credit and app_version_id<>0";