Hi,
Based on requirement,i have written a query and it contains huge data,but i need to do optimized. Plus, we need to restrict the output to only 15 users for each hmz_production_id. I actually dont know the best SQL to solve this.
Here is the sql
select hmz_production_id,ID from users
where (mod(floor(statval/256),2)
=1
or mod(floor(statval/128),2)=
1
or mod(floor(statval/512),2)=
1
or mod(floor(statval/2048),2)
=1)
and sub=1
group by hmz_production_id,id;
where id having index created on table.
please can anybody help me out to sort this.
Thanks in advance
Start Free Trial