Received: from ctron-dnm.ctron.com (ctron-dnm.cabletron.com [12.25.1.120]) by postgresql.org (8.11.3/8.11.1) with ESMTP id f5DLS2E20531 for ; Wed, 13 Jun 2001 17:28:02 -0400 (EDT) (envelope-from rhunter@enterasys.com) Received: (from uucp@localhost) by ctron-dnm.ctron.com (8.8.7/8.8.7) id RAA15007 for ; Wed, 13 Jun 2001 17:34:53 -0400 (EDT) Received: from cnc-exc1.ctron.com(134.141.77.96) by ctron-dnm.ctron.com via smap (4.1) id xma014957; Wed, 13 Jun 01 17:34:33 -0400 Received: by cnc-exc1.ctron.com with Internet Mail Service (5.5.2650.21) id ; Wed, 13 Jun 2001 17:27:31 -0400 Message-ID: <59358A738F45D51186A30008C74CE2500A079E@slc-exc1.ctron.com> From: "Hunter, Ray" To: "'Postres-sql' (E-mail)" Subject: Getting a specific row from a table Date: Wed, 13 Jun 2001 17:27:26 -0400 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2650.21) Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01C0F44F.A7208476" X-Archive-Number: 200106/202 X-Sequence-Number: 3458 This message is in MIME format. Since your mail reader does not understand this format, some or all of this message may not be legible. ------_=_NextPart_001_01C0F44F.A7208476 Content-Type: text/plain; charset="iso-8859-1" My problem is that I want to pull to specific rows from a query result. First here is the query: SQL-query: select card, status, time_stamp, comp_date from test_record where id = 45 order by card, comp_date Next here is the result: card status time stamp Comp_Date ER16-04 ER16-08 No 2001-06-13 13:56:52-06 6/10/01 ER16-04 ER16-08 Yes 2001-06-11 11:37:04-06 6/11/01 ER16-04 ER16-08 No 2001-06-11 13:13:07-06 6/11/01 ER16-04 ER16-08 No 2001-06-11 13:13:37-06 6/11/01 ER16-04 ER16-08 No 2001-06-13 13:57:41-06 6/12/01 ER16-04 ER16-08 Yes 2001-06-13 13:10:46-06 6/13/01 ER16-04 ER16-08 No 2001-06-13 13:35:29-06 6/13/01 SSR-ATM29-02 SSR-FDDI-02 No 2001-06-11 13:21:01-06 6/11/01 SSR-ATM29-02 SSR-FDDI-02 Yes 2001-06-11 13:21:17-06 6/11/01 SSR-ATM29-02 SSR-FDDI-02 No 2001-06-11 13:21:41-06 6/11/01 SSR-ATM29-02 SSR-FDDI-02 Yes 2001-06-11 13:22:21-06 6/11/01 What I want is the two rows that are bold. However this list will continue to grow and have more card types. I always want the last card type in the card group, because this has the comp_date that I am looking for. Thanks, RAY HUNTER Automated Test Group ENTERASYS NETWORKS Internal: 53888 Phone: 801 887-9888 Fax: 801 972-5789 Cellular: 801 698-0622 E-mail: rhunter@enterasys.com www.enterasys.com ------_=_NextPart_001_01C0F44F.A7208476 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Getting a specific row from a table

My problem is that I want to pull to spe= cific rows from a query result.

First here is the query:
SQL-query:
select card, status, time_stamp, comp_date
from test_record
where id =3D 45
order by card, comp_date

Next here is the result:

card      = ;              =              &n= bsp;  status          time sta= mp             =         Comp_Date
ER16-04 ER16-08     =               &= nbsp;     No         = ;     2001-06-13 13:56:52-06  6/10/01
ER16-04 ER16-08     =               &= nbsp;     Yes        &nbs= p;    2001-06-11 11:37:04-06  6/11/01
ER16-04 ER16-08     =               &= nbsp;     No         = ;     2001-06-11 13:13:07-06  6/11/01
ER16-04 ER16-08     =               &= nbsp;     No         = ;     2001-06-11 13:13:37-06  6/11/01
ER16-04 ER16-08     =               &= nbsp;     No         = ;     2001-06-13 13:57:41-06  6/12/01
ER16-04 ER16-08     =               &= nbsp;     Yes        &nbs= p;    2001-06-13 13:10:46-06  6/13/01
ER16-04 ER16-08    &nb= sp;             &nbs= p;      No        &n= bsp;     2001-06-13 13:35:29-06  6/13/01
SSR-ATM29-02 SSR-FDDI-02   &nb= sp;    No          &= nbsp;   2001-06-11 13:21:01-06  6/11/01
SSR-ATM29-02 SSR-FDDI-02   &nb= sp;    Yes          =    2001-06-11 13:21:17-06  6/11/01
SSR-ATM29-02 SSR-FDDI-02   &nb= sp;    No          &= nbsp;   2001-06-11 13:21:41-06  6/11/01
SSR-ATM29-02 SSR-FDDI-02   =      Yes         &nb= sp;   2001-06-11 13:22:21-06  6/11/01

What I want is the two rows that are bol= d.  However this list will continue to grow and have more card types.&= nbsp; I always want the last card type in the card group, because this has = the comp_date that I am looking for.

Thanks,

 
RAY HUNTER
Automated Test Group

 
ENTERASYS NETWORKS
 
Internal:     53888=
Phone:     &nb= sp; 801 887-9888
Fax:      = ;    801 972-5789
Cellular:     = 801 698-0622
E-mail:     &n= bsp; rhunter@en= terasys.com
 
www.enterasys.com<= /FONT>

------_=_NextPart_001_01C0F44F.A7208476--