Home » SQL & PL/SQL » SQL & PL/SQL » change to a different line using chr(10) when "select"
change to a different line using chr(10) when "select" [message #38152] Mon, 25 March 2002 22:04 Go to next message
chen xiangqin
Messages: 1
Registered: March 2002
Junior Member
I have a table like this:

> Select c1,c2 from l_ad;
c1 c2
aa 1
bb 2
I want it's output like:
aa
1
bb
2
So I type:
> Select c1||chr(10)||c2 from l_ad;
aa
1

bb
2

You can see there is another empty line beteen "1" and "bb". How to avoid this problem?
What's the difference of chr(10) and chr(13)?

FYI: My Oracle is V8, installed on HP-UX11.0.
Re: change to a different line using chr(10) when "select" [message #38156 is a reply to message #38152] Tue, 26 March 2002 04:18 Go to previous message
Alex Mazur
Messages: 17
Registered: March 2002
Junior Member
Try this:

select xfield
from
( select rowid, c1 xfield from l_ad
union
select rowid, to_char(c2) xfield from l_ad
order by 1
)
Previous Topic: Retrun a single row based on a row index specified as a function parameter
Next Topic: How to create scripts and run
Goto Forum:
  


Current Time: Fri Mar 29 09:02:42 CDT 2024