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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T14:05:52+00:00 2026-06-09T14:05:52+00:00

I have a table with the following structure – steamid, itemid, eventid, value ,

  • 0

I have a table with the following structure – steamid, itemid, eventid, value , all just ints or big ints that log hourly data I insert. So a user most likely has multiple entries with the same steamids, itemids, and even values.

I’m trying to get the 100 top values – but the same item must not repeat.

What I have so far is

SELECT itemid,value,steamid 
FROM $table 
GROUP BY itemid 
ORDER BY value DESC 
LIMIT 0,100

Which gives me this data set (sample only here):

itemid      value   steamid
=================================================
599291414   66397   76561198032389066
779150329   62882   76561198001229760
773965297   51895   76561198014617403
332883551   43201   76561197992659494
333434836   40880   7656119799359013

However, this for some reason ignores the true largest value listed in the table. I’m not sure how else I can format this so that I can ignore duplicate entries with the same itemid and steamid. I don’t think I can group by steamid because then it would ignore other items that could be associated with a steamid.

Here’s the first few if I select without grouping.

 itemid     value   steamid
 =====================================
 1011809265 753665  76561198010314894
 376615188  101684  76561197989760193
 478937438  83448   76561198010314894
 478937438  83448   76561198010314894
 376662587  72693   76561197989760193
 376662587  72693   76561197989760193
 599291414  66454   76561198032389066
 599291414  66454   76561198032389066
 599291414  66454   76561198032389066

Insight appreciated and I’ll gladly answer any questions that may help in figuring this out.

  • 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-09T14:05:53+00:00Added an answer on June 9, 2026 at 2:05 pm

    Try

    SELECT * FROM (
    
      SELECT itemid,value,steamid FROM $table GROUP BY itemid ORDER BY value DESC
    ) as tbl1
    
    GROUP BY itemid, value
    
    LIMIT 0,100
    

    This should unique itemid, but then give you only the single values.

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

Sidebar

Related Questions

I have a table with the following structure: itemId | direction | uid |
I have a table with the following structure: ID, Month, Year, Value with values
I have a table with the following structure uid sid eid Key value 1
I have a table by the following structure and records, All i want to
I have the following table structure ( reduced of course ): CREATE TABLE `log`
I have a table with the following structure GUID uniqueidentifier with default value newid(),
I have a table with the following structure key1 varchar(255) key2 varchar(255) value decimal(6,2)
I have a table with the following structure: timestamp, tagid, value I want a
I have following table structure there is column vid in that i want entry
I have mysql table with the following structure. All records are static and only

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.