Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. biltonguy

    Returning top n% of each group in a table...

    Sorry just realised the db is on sql server 2000 (which doesnt support row_number). Is there a simliar function in 2000?
  2. biltonguy

    Returning top n% of each group in a table...

    Thanks for the responses guys, I tried vongrunt's query out but i get this error "'row_number' is not a recognized function name." Very strange ive looked row_number up and it is a valid function. Any idea why it might be saying this? Forgive me if i'm a bit noob. Just out of college... :)
  3. biltonguy

    Returning top n% of each group in a table...

    Define top 5%: a) if there are 100 rows per group, retrieve 5% of 100 = 5 rows per group b) if highest value in a group is $100,000 retrieve rows with Salary >= $95,000 c) if total sum of salaries is $1,000,000 retrieve only top salaries until sum reaches 5% of that ($50,000)" Mostly a).. it...
  4. biltonguy

    Returning top n% of each group in a table...

    Hey there Ive been struggling with this one for a few days now.. Lets say I have one huge employee table (which includes the groupID and salary) containing everyone from managers to engineers to maintenance. I need a query that will return the records of the top 5% highest salaries of each...

Part and Inventory Search

Back
Top