Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8841727
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T10:47:33+00:00 2026-06-14T10:47:33+00:00

I am looking for the AVERAGE ( overall ) of the MINIMUM number (

  • 0

I am looking for the AVERAGE (overall) of the MINIMUM number (grouped by person).

My table looks like this:

Rank    Name
1   Amy
2   Amy
3   Amy
2   Bart
1   Charlie
2   David
5   David
1   Ed
2   Frank
4   Frank
5   Frank

I want to know the AVERAGE of the lowest scores. For these people, the lowest scores are:

Rank    Name
1   Amy
2   Bart
1   Charlie
2   David
1   Ed
2   Frank

Giving me a final answer of 1.5 – because three people have a MIN(Rank) of 1 and the other three have a MIN(Rank) of 2. That’s what I’m looking for – a single number.

My real data has a couple hundred rows, so it’s not terribly big. But I can’t figure out how to do this in a single, simple statement. Thank you for any help.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T10:47:34+00:00Added an answer on June 14, 2026 at 10:47 am

    Selecting the set of minimum values is straightforward. The cast() is necessary to avoid integer division later. You could also avoid integer division by casting to float instead of decimal. (But you should be aware that floats are “useful approximations”.)

    select name, cast(min(rank) as decimal) as min_rank
    from Table1
    group by name
    

    Now you can use the minimums as a common table expression, and select from it.

    with minimums as (
      select name, cast(min(rank) as decimal) as min_rank
      from Table1
      group by name
    )
    select avg(min_rank) avg_min_rank
    from minimums
    

    If you happen to need to do the same thing on a platform that doesn’t support common table expressions, you can a) create a view of minimums, and select from that view, or b) use the minimums as a derived table.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Looking for best advice on how to do this: I have an insert like
I really want to create a stunning-looking GUI desktop application that looks like, for
I am looking for a way to derive a weighted average from two rows
I'm looking for an elegant way to generate a sequence of the rolling average
Looking to do a bit of refactoring... Using NHibernate I have this query currently
I have a generalized search where I'm looking up average prices for the various
I'm looking for an elegant way to implement a moving average filter in c#.
I am looking for some reference on average latencies for lock cmpxchg instruction for
Say you have an average looking database. And you want to generate a variety
I'm looking for a way to calculate a useful average for a given set

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.