Re: Max
- From: Hugo Kornelis <hugo@xxxxxxxxxxxxxxxxxxxxxx>
- Date: Mon, 07 Nov 2005 23:45:47 +0100
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)
.
- Prev by Date: Re: Finding the Shift for current hour
- Next by Date: IF statement in SQL?
- Previous by thread: Re: Finding the Shift for current hour
- Next by thread: IF statement in SQL?
- Index(es):
Relevant Pages
|
|