Collin Peters <cadiolis@gmail.com> writes:
> Is there a nice simple query I can run that will return me a list of
> all the *latest* notes for all users (users can have many notes in the
> table)?
You can use SELECT DISTINCT ON for that, if you don't mind using a
Postgres-only feature. See the "weather reports" example in the SELECT
reference page.
If you want to stick to portable SQL, you can still do it, but it's
pretty ugly and slow. Look in the list archives for previous
discussions.
regards, tom lane