SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 latest record
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

alhakimi
Starting Member

Yemen
23 Posts

Posted - 01/24/2014 :  15:46:00  Show Profile  Reply with Quote
Hi friends ,

I need your help, i have table has column called [last modified date] it has time too , i need your assistant to get the [latest modified date] for particular ID , there are many updates to the ID and i just need the latest date.
[PAX ID] | [Last Modified Date]
1 2013-01-02 18:23:00
1 2013-01-02 11:42:00
3 2013-01-01 09:00:00
3 2013-01-08 16:05:00
5 2013-01-01 09:09:00

Regards

Alhakimi

tkizer
Almighty SQL Goddess

USA
35934 Posts

Posted - 01/24/2014 :  15:53:53  Show Profile  Visit tkizer's Homepage  Reply with Quote
select [pax id], max([last modified date])
from yourtable
group by [pax id]

Please do yourself a favor and fix those column names! There should be NO spaces.

Tara Kizer
SQL Server MVP since 2007
http://weblogs.sqlteam.com/tarad/
Go to Top of Page

alhakimi
Starting Member

Yemen
23 Posts

Posted - 01/24/2014 :  16:08:39  Show Profile  Reply with Quote
Thanks my friend
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.05 seconds. Powered By: Snitz Forums 2000