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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T16:14:15+00:00 2026-06-16T16:14:15+00:00

I have this following data in my database |NO | name |exp | mod_date

  • 0

I have this following data in my database

|NO | name  |exp   | mod_date          | 
+---+-------+------+-------------------+
|1  | dede  |  1   |2012-11-07 01:04:26|
|2  | dede  |  10  |2012-11-07 01:05:42|
|3  | GoGo  |  20  |2012-11-07 03:05:40|
|4  | baba  |  23  |2012-11-07 05:22:50|
|5  | baba  |  35  |2012-11-07 08:06:57|
|6  | baba  |  50  |2012-11-08 06:32:13|
|7  | rara  |  43  |2012-11-13 06:40:35|

I want to get the last update mod_date of each name :

|NO | name  |exp   | mod_date          | 
+---+-------+------+-------------------+
|2  | dede  |  10  |2012-11-07 01:04:26|
|3  | GoGo  |  20  |2012-11-07 03:05:40|
|6  | baba  |  50  |2012-11-08 06:32:13|
|7  | rara  |  43  |2012-11-13 06:40:35|

i tried this solution but it didnt work(same question)

SELECT no,name,exp,max(date) FROM skill_exp
GROUP BY name

and i get this result from that query

|NO | name  |exp   | mod_date          | 
+---+-------+------+-------------------+
|1  | dede  |  1   |2012-11-07 01:05:42|
|3  | GoGo  |  20  |2012-11-07 03:05:40|
|4  | baba  |  23  |2012-11-07 05:22:50|
|7  | rara  |  43  |2012-11-13 06:40:35|
  • 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-16T16:14:17+00:00Added an answer on June 16, 2026 at 4:14 pm

    The idea behind the subquery is that it separately gets the latest (maximum) mod_Date for each name. The result of which is then joined back to the original table to get other columns in each row.

    SELECT  a.*
    FROM    tableName a
            INNER JOIN
            (
                SELECT name, MAX(mod_date) maxDate
                FROM tableName
                GROUP BY name
            ) s ON  a.name = s.name AND
                    a.mod_date = s.maxDate
    
    • SQLFiddle Demo
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following form <form name=myForm id=myForm method=post enctype=multipart/form-data action=script.php> and this jQuery
Suppose we have a simple database containing following data: name apple pear banana grape
I have following data extracted from the MySQL database to create labels. BREAK Name:RAJ
I have this following setup, a textarea named with some data in it that
I have the following data: abc def; ghi. This regex will match: ([a-z0-9A-ZÀÁÂÃÄÅÇÈÉÊËÌÍÎÏÒÓÔÕÖÙÚÛÜÝàáâãäåçèéêëìíîïðòóôõöùúûüýÿ ]*)\W
I'm following this how-to to implement Core Data storage in my app: I have
Let's say I have a database filled with people with the following data elements:
I have a PostGreSQL database with the following data model: CREATE TABLE staff (s_id
In my MySQL database, I have this Time data type as one of my
I have to write a query to get the following data as result. I

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.