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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T13:50:19+00:00 2026-05-15T13:50:19+00:00

In reference to my previous question: One table, two column MYSQL query challenge The

  • 0

In reference to my previous question:
One table, two column MYSQL query challenge

The command:
“SELECT hostname, GROUP_CONCAT(DISTINCT name) as name FROM comments GROUP BY hostname”

returns the expected results:

192.168.0.1 user1,user2

192.168.3.5 user3

The same table “comments” also has a “timestamp” field. How do I include the latest (most current) timestamp for each user using that ip?

Example:

192.168.0.1 user1-1277146500,user2-1277250087

192.168.3.5 user3-1237150048

I tried a number of variations of the command, but could only get all the timestamps, not the most current one…

also.. if possible it would be nice to convert the epoch timestamp to something more friendly before displaying it.

  • 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-15T13:50:19+00:00Added an answer on May 15, 2026 at 1:50 pm
    SELECT 
         hostname, 
         GROUP_CONCAT(CONCAT_WS("-", name, m_timestamp))
    FROM
         (SELECT 
              hostname, 
              name,
              cast(max(timestamp) as char(24)) as m_timestamp 
         FROM 
              comments 
         GROUP BY 
              hostname,
              name) as A
    GROUP BY 
         hostname
    

    Edit

    Updated column name to timestamp (was c_timestamp) per OP’s comments

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

With a reference to my previous question , I would like to know how
In my previous question (regarding adding items to ArrayList) one of the posters wrote
As an extension to my previous question , I would like to automatically select
Thanks to Insin for answering a previous question related to this one. His answer
I'm writing this question with reference to this one which I wrote yesterday. After
Reference to previous question: Getting an ajax response in java from a web method
I have many objects reference the same class of stored data. In previous programs,
Reference: This is a self-answered question. It was meant to share the knowledge, Q&A
In reference with this question We have a header with a date picked component
With reference to the question I asked couple of days back, it seems to

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.