sql - MYSQL Query for top 10 users per location -
i need top 10 users per cc, based on total prints have made.
hierarchy looks this
- business unit
- cost centre
- user
it 1 many relation.
tables this:
business unit 'id', name, bu_no cost center 'id', bu_id, name user 'id', username, fullname, email, total_prints
this in excel, data mysql.
i need find mysql query show top 10 users (most prints) per cost centre.
any appreciated. thanks
sorting descending put prints @ top , limit 10 select top ten records.
here code sample show i'm talking about.
select * user user.id = cost_center.id order total_prints desc limit 10;
Comments
Post a Comment