Link to home
Start Free TrialLog in
Avatar of anumoses
anumosesFlag for United States of America

asked on

Oracle query- rows like columns

select count(unit_id),procedure_code,site_name
  from donations@pdon_new don,
       drives@pdon_new dr,
         sites s
 where coll_date  between '01-jan-2014' and '12-feb-2014'
   and don.drive_id = dr.drive_id
   and s.lt_location_id = dr.location_id
   and dr.location_id = 'LOCN100008'
   and don.unit_id is not null
   and don.donation_type = 'AL'
   and don.donor_id in (select donor_id
                          from hbc_donor_schedule sched
                         where sched.donation_type = 'AL'
                           and sched.status = 'CNFRM'
                           and sch_date > don.coll_date)
                                       group by procedure_code,site_name;

COUNT(UNIT_ID),    PROCEDURE_CODE,    SITE_NAME
        33,                      CO,                         Aurora Donor Center
          4,                      DR,                         Aurora Donor Center
          3,                      PL,                          Aurora Donor Center
       168,                     PP,                          Aurora Donor Center
          2,                      RP,                          Aurora Donor Center
          5,                      RS,                          Aurora Donor Center
        64,                      WB,                        Aurora Donor Center

I wanted the display to be as shown below

Aurora Donor Center  CO   DR  PL    PP     RP   RS    WB

                                   33    4     3   168    2    5     64
ASKER CERTIFIED SOLUTION
Avatar of slightwv (䄆 Netminder)
slightwv (䄆 Netminder)

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of anumoses

ASKER

No
Avatar of slightwv (䄆 Netminder)
slightwv (䄆 Netminder)

Then I do not believe you can do what you want.

You can generate a CSV or other delimited string then parse it out from the application but even with the application, you will likely need to know how many fields you will have.
I've requested that this question be deleted for the following reason:

I have a feeling that this question can be deleted as there is no possibility of getting what is required.
I believe you did get the answer to the question you asked.

Please review:  The experts told me “you can’t do that”. What do I do now?
http://support.experts-exchange.com/customer/portal/articles/755964
NA