PDA

View Full Version : sql query in postgres !


vishnu
04-01-02, 09:44
Hi! friends,
We are using postgres v7.1, i have one table which contain many fields & in that one field contain type text which has data like this

{"MS BONNIE DAVIS"}
{"MS KITTY BACK"}
{"MR JOHN ZENK","MRS DOROTHY ZENK"}
{"MS EVA MANDRAS"}
{"MS EVELYN MOSER"}
{"MS NORMA BABCOCK"}
{"MS LIDA EBY"}
{"MS LOIS LYLES"}
{"MS VONNIE WRIGHT"}
{"MS PAM TRAYLOR"}

So while query can it be possible to truncate special characters. i.e i
need to retrieve/display the below mentioned one.

MS BONNIE DAVIS
MS KITTY BACK
MR JOHN ZENK,MRS DOROTHY ZENK
MS EVA MANDRAS
MS EVELYN MOSER
MS NORMA BABCOCK
MS LIDA EBY
MS LOIS LYLES
MS VONNIE WRIGHT
MS PAM TRAYLOR

Thanks in advance

vishnu.

eperich
04-01-02, 15:39
the easiest way is that you create a function which truncates this characters

create function xy(value)



select xy(value) as whatever FROM table;


ready