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 6775897
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T15:57:43+00:00 2026-05-26T15:57:43+00:00

I am trying to display the maximum average salary; however, I can’t seem to

  • 0

I am trying to display the maximum average salary; however, I can’t seem to get it to work.

I can get a list of the average salaries to display with:

select worker_id, avg(salary)
from workers
group by worker_id;

However, when I try to display a list of the maximum average salary with:

select max (avg(salary))
from (select worker_id, avg(salary)
      from workers
      group by worker_id);

it doesn’t run. I get an “invalid identifier” error. How do I use the average salary for each worker to find the maximum average for each worker?

Thanks.

  • 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-05-26T15:57:43+00:00Added an answer on May 26, 2026 at 3:57 pm

    Columns resulting from aggregate functions (e.g. avg) usually get arbitrary names. Just use an alias for it, and select on that:

    select max(avg_salary)
    from (select worker_id, avg(salary) AS avg_salary
          from workers
          group by worker_id) As maxSalary;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Im trying to display some files in a web page so the user can
I am trying to display a list of users on a page based on
My table structure is (id,cluster,qid,priority). I'm trying to figure out how I can display
I am trying to display a text, that that will use the maximum possible
I am trying to get bubble effect. I have did the maximum with the
I'm trying to display the value of a slider control in a TextBlock. However
Trying to display a list filtered by the ‘term’ in autocomplete I have a
What I am trying to achieve is to get the rows having the maximum
Hey guys, Im trying to get the maximum number of days in a database
gcc 4.4.4 c89 However, I am having a problem trying to display all the

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.