Reputation: 95
I have the following queries:
Query 1:
select column1, column2 from table1 where column1 = 12345;
Results 1:
column1|column2
12345|Topics briefed:
|1) How to catch a fish
|without using a fishing rod
|2) How to cook a fish
Query 2:
select column1, REPLACE(REPLACE(column2, chr(10), ''), chr(13), '') as col2 from table1 where column1 = 12345;
Results 2:
column1|col2
12345|Topics briefed: 1) How to catch a fish
|without using a fishing rod 2) How to cook a fish
Results 2 is not what I wanted, I want everything to be in one row. How can I achieve the following results:
column1|col2
12345|Topics briefed: 1) How to catch a fish without using a fishing rod 2) How to cook a fish
Thanks in advance!
Upvotes: 0
Views: 1369
Reputation: 15094
You don't say how you're displaying these results, but my guess is that you actually have stripped out the line breaks, but whatever you're using to display them is wrapping them. If you're in sqlplus, you can do set linesize 999
to make the line very wide and column column2 format a200
to make column 2 display 200 characters wide.
Upvotes: 1
Reputation: 2573
Maybe this would work:
select column1, REPLACE(REPLACE(REPLACE(column2, chr(10), ''), chr(13), ''), chr(09), '') as col2
from table1
where column1 = 12345;
Upvotes: 3