Hi ,
I have a list of data as show below ,
Data1 Update Date
-- --
1 01-01-2004
2 01-01-2004
3 01-01-2004
1 01-01-2005
2 01-01-2005
3 01-01-2005
How can I build a query to select the "latest" update date data from this
list ?
Travis Tan
On Mon, 7 Nov 2005 08:31:14 -0800, Travis wrote:
>Hi ,
> I have a list of data as show below ,
> Data1 Update Date
> -- --
> 1 01-01-2004
> 2 01-01-2004
> 3 01-01-2004
> 1 01-01-2005
> 2 01-01-2005
> 3 01-01-2005
> How can I build a query to select the "latest" update date data from this
>list ?
Hi Travis,
Your question is not reallly clear. Providing expected output would have
been helpful. (And posting CREATE TABLE and INSERT statements even more;
check www.aspfaq.com/5006).
Anywway, here are two possible answers for two possible interpretations
of your question:
SELECT MAX("Update Date")
FROM YourTable
SELECT Data1, MAX("Update Date")
FROM YourTable
GROUP BY Data1
Best, Hugo
(Remove _NO_ and _SPAM_ to get my e-mail address)
sql
Monday, March 26, 2012
Max
Labels:
01-01-20041,
01-01-20042,
01-01-20043,
01-01-20052,
01-01-20053,
01-01-2005how,
below,
data1,
database,
date-,
max,
microsoft,
mysql,
oracle,
server,
sql,
update
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment