Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> Oracle qry

Oracle qry

From: <manoj.gurnani_at_orbitech.co.in>
Date: Tue, 11 Mar 2003 01:17:02 -0800
Message-ID: <F001.00565AFF.20030311011702@fatcity.com>


Hi All,

         I've the following qry :

select distinct(decode(b.sys_id,'TRDENG',a.cust_bas_no,a.cosmos_base_no)) baseno ,a.br_cod,pty_nam,bank_name
from piar_fr_psd a, psd b, bank_br c
where a.psd_id=b.psd_id
and a.psd_serial_num = b.psd_serial_no
and b.bank_id = c.bank_id
and (((sys_id = 'TRDENG') and (a.cust_bas_no is not null)) or ((sys_id <> 'TRDENG') and (a.cosmos_base_no is not null)))

o/p :
baseno br_cod pty_nam bank_name

 1        10     x1     y1
 1        10     x111   y1
 1        10     x1334  y1
 2        20     x212   y2
 2        20     x213   y2

For a baseno,br_cod combination I need only one row to be displayed. i.e any one pty_nam should be displayed .

o/p :

baseno br_cod pty_nam bank_name

 1        10     x1     y1
 2        20     x213   y2

How can I achieve this.

Thanks
Manoj         

--

Please see the official ORACLE-L FAQ: http://www.orafaq.net
--

Author:
  INET: manoj.gurnani_at_orbitech.co.in

Fat City Network Services    -- 858-538-5051 http://www.fatcity.com
San Diego, California        -- Mailing list and web hosting services
---------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_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). Received on Tue Mar 11 2003 - 03:17:02 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US