Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: getting the results horizontal..
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;
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
![]() |
![]() |