X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (neptune.hub.org [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 5AAADD1B498 for ; Wed, 10 Dec 2003 20:25:35 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 15708-09 for ; Wed, 10 Dec 2003 16:25:05 -0400 (AST) Received: from unix.mail.Virginia.EDU (unix.mail.Virginia.EDU [128.143.2.28]) by svr1.postgresql.org (Postfix) with ESMTP id AA82DD1B468 for ; Wed, 10 Dec 2003 16:25:02 -0400 (AST) Received: from smtp.mail.Virginia.EDU (smtp.mail.Virginia.EDU [128.143.22.52]) by unix.mail.Virginia.EDU (Postfix) with ESMTP id 410F7A8AF for ; Wed, 10 Dec 2003 15:24:45 -0500 (EST) Received: from virginia.edu (d-137-133-128.bootp.Virginia.EDU [137.54.133.128]) by smtp.mail.Virginia.EDU (Postfix) with ESMTP id B476121042 for ; Wed, 10 Dec 2003 15:24:44 -0500 (EST) Message-ID: <3FD783F6.6030801@virginia.edu> Date: Wed, 10 Dec 2003 15:37:10 -0500 From: Jodi Kanter User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.5) Gecko/20031007 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Postgres SQL List Subject: picking max from list Content-Type: multipart/alternative; boundary="------------010705030006050506040000" X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200312/86 X-Sequence-Number: 16252 This is a multi-part message in MIME format. --------------010705030006050506040000 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit 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 / / / / / --------------010705030006050506040000 Content-Type: text/html; charset=us-ascii Content-Transfer-Encoding: 7bit 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


 

 

 

--------------010705030006050506040000--