last entry per person

From: garry <garry(at)scholarpack(dot)com>
To: PostgreSQL General <pgsql-general(at)postgresql(dot)org>
Subject: last entry per person
Date: 2012-02-03 08:26:23
Message-ID: 4F2B9A2F.3060205@scholarpack.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I have a table which holds a user name and their results in exams. There
can be multiple entries per user. I am trying to return the last entry
for each user. I can get the last entry in the table using the order
by/limit method but how would this be applied per user. My table
definition is like the following:

> gradeid serial primary key,
> user text,
> grade char(1),
> entered timestamp,
Any help would be appreciated.
Regards
Garry

Attachment Content-Type Size
garry.vcf text/x-vcard 270 bytes

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Chris Travers 2012-02-03 08:30:20 Re: last entry per person
Previous Message Andreas Kretschmer 2012-02-03 08:22:47 Re: Understanding EXPLAIN