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

Home -> Community -> Usenet -> c.d.o.misc -> Re: getting the results horizontal..

Re: getting the results horizontal..

From: Michel Cadot <micadot_at_netcourrier.com>
Date: Fri, 24 Sep 1999 10:58:31 +0200
Message-ID: <7sfehd$8kt$1@oceanite.cybercable.fr>


You can do it with a PL/SQL bloc or a function:

create or replace function f return varchar is

   result varchar2(32000) := '';
   cursor curs is select name from employee;    first boolean := true;
begin

   for rec in curs loop

      if first then
         result := rec.name;
         first := false;
      else
         result := result || ' ' || rec.col;
      end if;

   end loop;
   return result;
end;
/

Ronald Moleveld a écrit dans le message <7se8ph$sc8$1_at_news.castel.nl>...
>Hi,
>
>Is there a possibility to get the results of a query horizontal i.e. than
>vertical?
>
>Example:
>select name from employee
>returns:
>
>Smith
>Jones
>King
>...
>...
>...
>
>I want to have the results as:
>
>Smith Jones King ... ... ...
>
>
>Any idea?
>
>
>Ronald.
>
>
>
Received on Fri Sep 24 1999 - 03:58:31 CDT

Original text of this message

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