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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T00:18:44+00:00 2026-06-14T00:18:44+00:00

Picture this… a person adds a row of data about a computer into mysql

  • 0

Picture this… a person adds a row of data about a computer into mysql and he again adds another row of essentially same row of data except that the date is different where each date is always stamped with the insert.

I want to be able to eliminate duplicates and show only the most recent row.

Let’s say we have a “computers” table with 3 fields: ID, COMPUTER, DATEADD

inside the table goes like this

1, dell, 2010-10-09
2, dell, 2011-10-10
3, gateway, 2010-03-03
4, dell, 2010-02-02

simple, ok… how do I get rid of dups of dell and only get dell with the latest date?

I tried this query:

 SELECT * 
  FROM  `computers` 
  GROUP BY computer
  ORDER BY dates ASC 

it doesnt perform as I expect – the date is not the latest.

  • 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-14T00:18:45+00:00Added an answer on June 14, 2026 at 12:18 am

    Use DESC instead of ASC:

    SELECT * 
    FROM  `computers` 
    GROUP BY computer
    ORDER BY dateadd DESC;
    

    UPDATE 1

    Another shot:

    SELECT *
      FROM computers c
     WHERE dateadd = (SELECT MAX(dateadd) 
                        FROM computers 
                       WHERE computer = c.computer)
    

    but some problems might arise, if you have two or more entries of the same computer for one date.

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

Sidebar

Related Questions

This picture gallery adds children. It does what it needs to, but throws a
Picture this: you are creating a little module that people can incorporate into their
In this picture,there are 3 main steps: SetExpressCheckout , GetExpressCheckoutDetails and DoExpressCheckoutDetails ,I'm now
Whats wrong with this picture? Model: validates_acceptance_of :terms_of_service, :on => :create, :accept => true,
Please look at this picture: Is it possible to find per-column sum for all
first take a look on this picture from localScope app : i have 2
Say each pixel in this picture(fig 1) is an element in an array. How
Have a look at this picture alt text http://www.abbeylegal.com/downloads/2009-04-01/web%20part%20top%20line.jpg Does anyone know what css
I want to download this picture using Ruby. How do I do that? http://farm1.static.flickr.com/92/218926700_ecedc5fef7_o.jpg
I have a picture in res/drawable directory: res/drawable/picture.jpeg. Can I dynamically update this picture.jpeg

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.