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

The Archive Base Latest Questions

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

My table structure (in SQL Server) looks something like this: (D1 is more recent

  • 0

My table structure (in SQL Server) looks something like this: (D1 is more recent than D2, PK is a normal Identity(1,1) column)

Name  Type  Score  Date
A1    B1    C1     D1
A1    B2    C2     D1
A1    B1    C3     D2

What I need to do is find the latest Score values for each unique combination of Name and Type, i.e.:

A1    B1    C1     D1
A1    B2    C2     D1

I had originally done this by just using yesterday’s date, but not everything is updated daily so sometimes scores were missing.
I can get the unique combinations I need to look at with a simple

SELECT Name, Type FROM Table GROUP BY Name, Type ORDER BY MAX(Date)

but I obviously can’t add the other two columns or the groups are no longer unique.

I’ve had a look at similar questions but they all have differences that make them less useful for me.

Any help is much appreciated. I have a feeling that it’s a fairly simple problem and that I just don’t know enough to figure it 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-05-24T02:56:37+00:00Added an answer on May 24, 2026 at 2:56 am
    SELECT s.Name, s.Type, s.Score
    FROM (
        SELECT Name, Type, MAX(Date) AS MaxDate
        FROM Scores
        GROUP BY Name, Type
    ) m
    INNER JOIN Scores s ON m.Name = s.Name AND m.Type = s.Type AND m.MaxDate = s.Date
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using SQL Server 2008. I have a database table that looks like this
I have a table in SQL Server that is structured like this: id Name
I have a table in SQL server that has the normal tree structure of
Table structure goes something like this: Table: Purchasers Columns: id | organization | city
My table structure looks like this: tbl.users tbl.issues +--------+-----------+ +---------+------------+-----------+ | userid | real_name
I inherited an interesting table structure. This table structure looks like the following: GroupTable
Sql Server 2005 Table Structure CREATE TABLE [dbo].[Rate]( [RateID] [bigint] IDENTITY(1,1) NOT NULL, [PairID]
Given the following simple table structure (SQL Server 2008), I want to be able
In my sql server table, I want to add a computed column that is
I have a SQL Server table with the following structure cod_turn (PrimaryKey) taken (bit)

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.