Message-Id: <10530.109575@fatcity.com> From: "Shockey, David" Date: Fri, 16 Jun 2000 11:59:17 -0500 Subject: RE: Help - Query 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_01BFD7B5.DBECAFFC Content-Type: text/plain; charset="iso-8859-1" If I understand your question correctly, this should work. select contractor_number, synthetic_code, max(issue_number) issue_number from contractor_rates group by contractor_number, synthetic_code -----Original Message----- From: Mahip Narayan [mailto:Mahip@mahindrabt.com] Sent: Friday, June 16, 2000 10:04 AM To: Multiple recipients of list ORACLE-L Subject: Help - Query Hi Lists, I have a table CONTRACTOR_RATES like this - Primay key is - (CONTRACTOR_NUMBER,SYNTHETIC_CODE,ISSUE_NUMBER) Name Null? Type ------------------------------- -------- ---- CONTRACTOR_NUMBER NOT NULL VARCHAR2(8) SYNTHETIC_CODE NOT NULL VARCHAR2(4) ISSUE_NUMBER NOT NULL NUMBER(6) BT_RATE NUMBER(7,2) BASIC_RATE NUMBER(7,2) STORES_RATE NUMBER(7,2) The objective is Given a particular contractor_number List the maximum issue_number and relevant details(bt_rate,....) synthetic_code wise. Can anybody pl. give the query. Contractor_number synthetic_code Issue_number 11 1 5 12 1 10 11 2 3 11 3 1 11 1 6 11 2 8 Output if we input Contractor_number = 11 should be - 11 1 6 with other three fields values 11 2 8 with other three fields values 11 3 1 with other three fields values TIA, Mahip Narayan -- Author: Mahip Narayan INET: Mahip@mahindrabt.com Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051 San Diego, California -- Public Internet access / Mailing Lists -------------------------------------------------------------------- To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru@fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). ------_=_NextPart_001_01BFD7B5.DBECAFFC Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable RE: Help - Query

If I understand your question correctly, this should = work.

select contractor_number, synthetic_code, = max(issue_number) issue_number
from contractor_rates
group by contractor_number, synthetic_code

-----Original Message-----
From: Mahip Narayan [mailto:Mahip@mahindrabt.com]
Sent: Friday, June 16, 2000 10:04 AM
To: Multiple recipients of list ORACLE-L
Subject: Help - Query


Hi Lists,
I have a table CONTRACTOR_RATES like this -
Primay key is - = (CONTRACTOR_NUMBER,SYNTHETIC_CODE,ISSUE_NUMBER)

 Name         = ;            = ;       Null?    = Type
 ------------------------------- -------- = ----
 CONTRACTOR_NUMBER      &nbs= p;        NOT NULL = VARCHAR2(8)
 SYNTHETIC_CODE       &= nbsp;          NOT NULL = VARCHAR2(4)
 ISSUE_NUMBER       &nb= sp;            = NOT NULL NUMBER(6)
 BT_RATE        &n= bsp;           &n= bsp;           &n= bsp; NUMBER(7,2)
 BASIC_RATE        = ;            = ;           = NUMBER(7,2)
 STORES_RATE       &nbs= p;           &nbs= p;          = NUMBER(7,2)

The objective is Given a particular = contractor_number
List the maximum issue_number and relevant = details(bt_rate,....)
synthetic_code wise. Can anybody pl. give the = query.

Contractor_number     = synthetic_code      Issue_number
11          &= nbsp;           &= nbsp; = 1            = ;       5
12          &= nbsp;           &= nbsp; = 1            = ;       10
11          &= nbsp;           &= nbsp; = 2            = ;       3
11          &= nbsp;           &= nbsp; = 3            = ;       1
11          &= nbsp;           &= nbsp; = 1            = ;       6
11          &= nbsp;           &= nbsp; = 2            = ;       8

Output if we input Contractor_number =3D 11 should be = -
11          &= nbsp;           &= nbsp; = 1            = ;       6  with other three = fields
values
11          &= nbsp;           &= nbsp; = 2            = ;       8  with other three = fields
values
11          &= nbsp;           &= nbsp; = 3            = ;       1  with other three = fields
values

TIA,
Mahip Narayan

--
Author: Mahip Narayan
  INET: Mahip@mahindrabt.com

Fat City Network Services    -- (858) = 538-5051  FAX: (858) 538-5051
San Diego, = California        -- Public Internet = access / Mailing Lists
---------------------------------------------------------------= -----
To REMOVE yourself from this mailing list, send an = E-Mail message
to: ListGuru@fatcity.com (note EXACT spelling of = 'ListGuru') and in
the message BODY, include a line containing: UNSUB = ORACLE-L
(or the name of mailing list you want to be removed =