Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Simple SQL question
In article <pfk7u1pti7cg82d0fpoueq49382m6bb79q_at_4ax.com>, Andy Hassall
says...
> On Fri, 3 Feb 2006 14:58:18 -0000, Jeremy <jeremy0505_at_gmail.com> wrote:
>
> >I am not familiar with TRANSLATE (I know it's not new but I
> >never found the need to use until now (?))
> >
> >So to get from:
> >'the cat sat on the mat'
> >to
> >'the cat sat on the mat'
> >
> >using a TRANSLATE statement would be?
>
> ... impossible, I think, since translate does simple single-character
> transliterations, whereas the OP wants pairs of spaces turned into single
> spaces.
>
>
The OP was me. I illustratd with a simple loop to replace all ' ' with ' ' and asked if it there was a simpler way of doing it.
Daniel stated:
"On the other hand one could TRANSLATE(somevalue_or_column, 'A ', 'A' and have no procedural code at all."
Daniel if you are reading - was it us who have misunderstood the power of TRANSLATE or you who misunderstood the original question? Either answer is acceptable!
-- jeremyReceived on Mon Feb 06 2006 - 08:00:37 CST