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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T06:56:47+00:00 2026-05-24T06:56:47+00:00

Hi is there a statistical method to find the most popular occuring value within

  • 0

Hi is there a statistical method to find the most popular occuring value within a column in a table.

For this table:

Table “resource” -linking table for M:M

+------------+---------------------+-----------+
| resource_pk| user_fk             | supply_fk |
+------------+---------------------+-----------+
| 1          | 124124              |     1     |
| 2          | 265235              |     2     |
| 3          | 253255              |     1     |
| 4          | 151255              |     1     |
| 5          | 154233              |     3     |
+------------+---------------------+-----------+

So in this example the most popular supply_fk was “1”.

I want to find the most popular value of the column “supply_fk” within that table.

I tried this:

Select *
From resource
Group By *
Order By supply_fk Desc
LEFT JOIN
supply
ON
supply.supply_pk = resource.supply_fk

However all this does is give me the “supply_fk” with the highest number value which was “3” which then points to another table giving me “medical scissors”.

When “1” should be “scalpel”

Im guessing there is a MySQL statistical function for this? I tried googling but all I got was Min, Max and Middle

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-24T06:56:48+00:00Added an answer on May 24, 2026 at 6:56 am

    You can group, order by the count and get the first record:

    select r.supply_fk, s.name, count(*)
    from resource r
    inner join supply s on s.supply_pk = r.supply_fk
    group by r.supply_fk, s.name
    order by count(*) desc
    limit 1
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have lots of tables with statistical data (environment related) and wondering if there
Most statistics out there for browser stats show you the resolution of the screen.
I'm writing a statistics based application off a SQLite database. There is a table
There are two popular closure styles in javascript. The first I call anonymous constructor
There is previous little on the google on this subject other than people asking
I have this method: public static int what(String str, char start, char end) {
Is there a built-in method in System.Diagnostics for retrieving all of the instantiated performance
Is there any way to to this: def getChannelListJSON = { def results =
I have dll method that should be QoSed - this method should be called
Are there statistics or even estimates anywhere regarding the sizes of the various sectors

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.