A very minor change on your query is all that is needed.
select max(x.timestamp),x.value,x.person from table as x,
(select person,max(value) as maxvalue from table group by person order by
maxvalue desc) as y
where x.person = y.person
and x.value = y.maxvalue
group by x.person, x.value
I don't
On Fri, Jan 13, 2012 at 6:22 AM, Simon Slavin wrote:
>
> On 13 Jan 2012, at 11:07am, Dilip Ranganathan wrote:
>
> > I have a table that looks like something like this:
> >
> >timestampvalue person
> >===
> >2010-01-
On 13-01-2012 12:07, Dilip Ranganathan wrote:
> I have a table that looks like something like this:
>
> timestampvalue person
> ===
> 2010-01-12 00:00:00 33 emp1
> 2010-01-12 11:00:00 22
On 13 Jan 2012, at 11:07am, Dilip Ranganathan wrote:
> I have a table that looks like something like this:
>
>timestampvalue person
>===
>2010-01-12 00:00:00 33 emp1
>2010-01-12 11:00:00
I have a table that looks like something like this:
timestampvalue person
===
2010-01-12 00:00:00 33 emp1
2010-01-12 11:00:00 22 emp1
2010-01-12 09:00:00 16
5 matches
Mail list logo