Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: How can I write column values horizontally ?
Hi,
You can create a function that will return a string / varchar / char.
In it create a cursor, or cursors,
to loop through the rows,
and concatenate them to the return variable.
Return the variable.
Use it:
select stud_id,
stud_and_designations(student_id )
from ...
where ....
It should work ok.
Argosy
In article <7kqbl4$344$1_at_nnrp1.deja.com>,
kgsudhi_at_hotmail.com wrote:
> Please help me to get the result like
>
> ABC B.Sc M.SC Diploma
> XYZ BE M.Tech
>
> From the following tables.
>
> stud Deg
> -------------- --------------
> sl number(2) Primary Key sl_ref number(2) foreign key
stud.sl
> name varchar2(20) deg_name varhcar2(2)
>
> select * from stud;
>
> sl name
> -- ----
> 1 ABC
> 2 XYZ
>
> Select * from Deg;
>
> sl_ref Deg_name
> ------ --------
> 1 B.Sc
> 1 M.Sc
> 1 Diploma
> 2 BE
> 2 M.Tech
>
> Regards
> Sudheer
>
> Sent via Deja.com http://www.deja.com/
> Share what you know. Learn what you don't.
>
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
Received on Fri Jun 25 1999 - 14:21:53 CDT