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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T22:29:59+00:00 2026-06-14T22:29:59+00:00

I have in the table 30 records with the same Title but different Ids

  • 0

I have in the table 30 records with the same Title but different Ids and dates each one. How to return in the query de most recent by date?

The table looks like this:

Id - Title - Date
-----------------
1 - africa - 2012-11-27
2 - africa - 2012-11-26
3 - africa - 2012-11-25

I need a query that returns the record which Id is 3, that is the most recent by the date. All I’ve tried until now using GROUP BY is only returning the record wich Id is 1. How can I do that?

  • 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-14T22:30:00+00:00Added an answer on June 14, 2026 at 10:30 pm

    You want to get the first record but that is not the recent. The idea behind the subquery is that it gets the first date for each title and joined it against itself provided that it match the title and the date.

    SELECT  a.*
    FROM    tableName a
            INNER JOIN
            (
                SELECT  title, MIN(DATE) minDate
                FROM tableName
                GROUP BY title
            ) b ON a.title = b.title AND
                    a.date = b.maxDate
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two tables with exactly the same fields. Table A contains 7160 records
I have in my table records that are related one to another by a
I have a table where one or more entries with the same 'id' value
I have the same problem as described in ( Last record of Join table
I have following Table with records for ActivityLog: ID, UserId, Category, Created 1 11
i have two table. Records and Villas Records table : ID, VID (Villa ID),
I have table a joining table b, I only want the records from table
I have table with 300 000 records (MyISAM). I get record from this table
I have a table that has records with a structure similar to this.. ID
I have a innoDB table which records online users. It gets updated on every

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.