Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
Aditya_gupt
Starting Member
1 Post |
Posted - 2012-06-29 : 14:29:05
|
| Hi All,Need your help in finding the solution for the below requirement:Table has details like below:NAME UPATE-TIMESTAMP==== ===============mary time1mary time2mary time3tom time1tom time2tom time3tom time4richard time1richard time2Output Expected:NAME UPATE-TIMESTAMP==== ===============mary time3 - this time should be max for all records related to mary i.e. latest time.tom time4 - this time should be max for all records related to tom i.e. latest time.richard time2 - this time should be max for all records related to richard i.e. latest time.In summary, the requirement is to fetch the latest upated record for each unique NAME.Thanks in advance. |
|
|
robvolk
Most Valuable Yak
15732 Posts |
Posted - 2012-06-29 : 15:01:18
|
| SELECT NAME, MAX(UPATE-TIMESTAMP) UPATE-TIMESTAMPFROM myTableGROUP BY NAME |
 |
|
|
|
|
|