November 22, 2004 at 6:25 am
Can I do this with SQL statements :-
Input String :
"I am a boy of age 10."
Output String:
"I am a boy of age 10."
Thanks
Yuvraj
November 22, 2004 at 8:43 am
select
replace(
replace(
replace(
replace(
'I am a boy of age 10.',
' ', ' '),
' ', ' '),
' ', ' '),
' ', ' ')
This will only work if you can define a maximum number of spaces between words. Otherwise, I think you'll need some loooping, which is expensive.
November 22, 2004 at 9:02 am
The forum messed up the spaces in the post; but you get the idea.
November 22, 2004 at 6:02 pm
You would put looping code like that into a user defined function, and be able to use it in a select statement returning many rows.
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply