Substitute

Поиск
Список
Период
Сортировка
Искать

Substitute

От:
Judith <jaltamirano@correolux.com.mx>
Дата:
Hello everybody....

somebody knows, how I can substitute in a query if a field contains a 
character that I want to be shown with other character?
for example if I have a \n I want to shows me a ~ in the result of the 
select

thanks in advanced!!


Re: Substitute

От:
"Milen A. Radev" <milen@radev.net>
Дата:
Judith написа:
> Hello everybody....
> 
> somebody knows, how I can substitute in a query if a field contains a
> character that I want to be shown with other character?
> 
> for example if I have a \n I want to shows me a ~ in the result of the
> select
> 

Look for 'replace' here -
http://www.postgresql.org/docs/8.2/static/functions-string.html.


-- 
Milen A. Radev


Re: Substitute

От:
Michael Fuhr <mike@fuhr.org>
Дата:
On Tue, Mar 20, 2007 at 05:54:47PM -0600, Judith wrote:
> somebody knows, how I can substitute in a query if a field contains a 
> character that I want to be shown with other character?
> 
> for example if I have a \n I want to shows me a ~ in the result of the 
> select

One way is with translate().  See "String Functions and Operators"
in the documentation for more information.

http://www.postgresql.org/docs/8.2/interactive/functions-string.html

-- 
Michael Fuhr

FAQ