Solved

Select Top -- Order By SQL Servef

Posted on 2009-07-14
1
156 Views
Last Modified: 2012-05-07
Hello Expert. May I please have some assistance? I would like to do a select and retrieve one row. I would like to have the most recent modified date to be returned. This Table has multiple rows for the same client id. But the client id is my trigger for returning records.

Thanks for you assistance.
0
Comment
Question by:lemarge
1 Comment
 
LVL 75

Accepted Solution

by:
Aneesh Retnakaran earned 500 total points
ID: 24849982
select ClientID, MAX(ModifiedDate) modifiedDate
from urTable
GROUP BY ClientID

--to get the most recent record
SELECT * FROM urTable WHERE ModifieDate = (SELECT MAX(ModifiedDate) from urTable )
0

Featured Post

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
sql Audit table 3 75
Restrict result set 1 39
create insert script based on records in a table 4 24
How do I subtract date and time within a same column in SQL 4 41
In this article I will describe the Backup & Restore method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

827 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question