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

  1. business unit
  2. cost centre
  3. 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

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -