pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jodi Kanter <jkanter@virginia.edu>
To: Postgres SQL List <pgsql-sql@postgresql.org>
Subject: picking max from list
Date: Wed, 10 Dec 2003 15:37:10 -0500
Message-ID: <3FD783F6.6030801@virginia.edu> (raw)

I have a query that produces results similar to this:

run#      rd_pk      group#
0            9209      5  
1            9209      8
0            9520      2
1            9520      5
0            9520   etc....
0            8652
1            8652
2            8652
0            8895  
1            8894

Ultimately I want to know the group number for EACH rd_pk with the 
highest run number. Can this be done in one query? Or will I need to 
code with a loop?
Thanks
Jodi
-- 

/_______________________________
//Jodi L Kanter
BioInformatics Database Administrator
University of Virginia
(434) 924-2846
jkanter@virginia.edu <mailto:jkanter@virginia.edu>/

 

/ /

/ /

view thread (3+ messages)  latest in thread

Message-ID: <3FD783F6.6030801@virginia.edu>
Permalink:  ../3FD783F6.6030801@virginia.edu/
Also on:    postgresql.org/message-id/3FD783F6.6030801@virginia.edu

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: jkanter@virginia.edu
  Subject: Re: picking max from list
  In-Reply-To: <3FD783F6.6030801@virginia.edu>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox