TechSpott - Computer and technology forums

Go Back   TechSpott - Computer and technology forums > Webmasters > Database Management > MySQL
MySQL Forum dedicated to the world's most popular open source database engine.

Reply
 
Thread Tools Display Modes
Old April 20th, 2010, 09:27 PM   #1 (permalink)
fiber
Guest
 
Posts: n/a
Default In MySQL, how do I select distinct records, but still select more data?

In MySQL, I want to select emails, firstname, date, etc from past orders where the email is unique. I

then want to show other fields for that same row with the first match (the oldest) in the database. For example:

Example Real Data:
ID,Email, Name,ORDER DATE
1,mark@domain.com,Mark,12-2-09
2,popular@domain.com,Jim,1-5-10
3,Mark@domain.com,Mark,2-3-10
4,test@test.org,Bob,2-9-10
5,mark@domain.com,Mark,3-1-10


Of the above data, I only want it to show distinct my email, but the other info still there:

Example Distinct Data:
ID,Email,Name,ORDER DATE
1,mark@domain.com,Mark,12-2-09
2,popular@domain.com,Jim,1-5-10
4,test@test.org,Bob,2-9-10


Do you know the correct MySQL query for this?


Thanks!
  Reply With Quote Share with Facebook
Reply

Bookmarks

Tags
data, distinct, mysql, records, select


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
removal of mysql data? Chessbaillie MySQL 0 April 18th, 2010 12:29 PM
Oracle Announces MySQL Cluster 7.1 News Bot News 0 April 13th, 2010 09:47 PM
how can I make a link which will display data entries from mysql table? RickyG MySQL 0 April 11th, 2010 07:16 AM
Why does mysql keep inserting data in random places and how can I fix this? John C MySQL 0 March 31st, 2010 03:41 PM
How do I make my MySQL table automatically make a timestamp when new data is added? Carbonbased Lifeform MySQL 0 March 31st, 2010 03:40 PM

 
Forum Stats
Members: 14,373
Threads: 20,382
Posts: 27,863
Total Online: 61

Newest Member: nnpccpecyvh

Latest Threads

Advertisements

Support our advertisers!

Amazon
Sears
Macys
1800flowers.com
Drugstore.com


Carbonite Online-Backups
Tiger Direct
Tech Depot
Buy.com
Office Depot
Fatcow
HostGator


TripsNow.us
Marriott
Expedia
CheapTickets.com
OneTravel
Hotwire

Are you a Fan?

Share this on Facebook

Tag Cloud

Partner Links


Contact Us - Home - Archive - Privacy Statement - Top - Copyright © 2009-2010, TechSpott - All times are GMT -4. Time is 08:22 PM

Powered by vBulletin® Copyright © Jelsoft Enterprises Ltd. :: SEO by vBSEO