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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T00:42:43+00:00 2026-06-02T00:42:43+00:00

Have a database with three columns – gamekey, teamed, final score. I am trying

  • 0

Have a database with three columns – gamekey, teamed, final score. I am trying to find the score differential for each gamekey.

Gamekey. Teamed. Finalscore
 16      27      21
 16       7      24
 17      22      17   
 17      21      10
 18      15      9
 18      11      3

Desire output would be

Gamekey.   Scorediff
16         3
17         7
18         6
  • 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-02T00:42:45+00:00Added an answer on June 2, 2026 at 12:42 am

    Looks like you want the absolute value of the difference, so you could use;

    SELECT Gamekey, max(Finalscore) - min(Finalscore) as Scorediff
    FROM TableName
    GROUP BY Gamekey
    

    –adding the below for validation you ran (granted the below was tested in SQL Server)

    declare @testTable as table(Gamekey int, Teamed int, Finalscore int)
    
    INSERT INTO @testTable values(16,27,21)
    INSERT INTO @testTable values(16,7,24)
    INSERT INTO @testTable values(17,22,17)   
    INSERT INTO @testTable values(17,21,10)
    INSERT INTO @testTable values(18,15,9)
    INSERT INTO @testTable values(18,11,3)
    
    
    SELECT Gamekey, max(Finalscore) - min(Finalscore) as Scorediff
    FROM @testTable
    GROUP BY Gamekey
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Lets say I have a database table which consists of three columns: id ,
At the moment I want to have three columns in my database for Notes:
I have a database that has three columns Maker, Model and Price and I
My cose is SIMPLE. I have a SQLite-Database with three columns : rowid title
I have a sqlite database. I have three columns:_id, date, value. I now want
I have table Messages in MySQL database. It has three columns: msg_id, user_id, msg_content
Say I have a database table with three columns: ID, Name, and Age. I
I have a datagridview that is linked to a three columns in the database,
I have this database scheme: http://i54.tinypic.com/k9hzc.png As you can see, I have three columns
I have a SQL Server 2008 database table with three varchar Columns - Col1,

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.