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

  • Home
  • SEARCH
  • 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 8311713
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T19:54:21+00:00 2026-06-08T19:54:21+00:00

I have an SQL database with a table like this: ObjID Rating 123 1

  • 0

I have an SQL database with a table like this:

ObjID Rating
123   1
333   0
123   0
123   1
567   1

An Ojbect ID can show up in the table multiple times with different ratings, I need a way to select a “distinct” ObjID check all of its ratings and compare that to all other “distinct” ObjIDs and compare those ratings. In the end I should have the 1st – 3rd ObjIDs with the over all highest ratings, in this example 123, 567 and 333 would be printed 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-08T19:54:23+00:00Added an answer on June 8, 2026 at 7:54 pm

    So the rating of each object is the total sum of all ratings for that object in the table?

    SELECT ObjID, SUM(Rating) AS TotalRating
    FROM ObjectTable
    GROUP BY ObjID
    ORDER BY SUM(Rating) DESC
    LIMIT 3
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a table like this in my database (SQL Server 2008) ID Type
I'm using SQL Server 2008. I have a database table that looks like this
I have a SQL 2008 database table like this name score ----------------------- steve 207
In my sql database I have a table like REG_DET, This table mainly include
I have a SQL database with two tables like this: Users Id (PK) Name
If I have the name of a database table like this: string tableName =
I have a database table like this: id | check_number | amount 1 |
Here is what i have: a SQL CE database, that holds this Category table,
I have questions which are represented like this in my SQL database : CREATE
I have a database table structured like this (irrelevant fields omitted for brevity): rankings

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.