update part of a column record

--_000_B0D7C0A3F35FE144A70312D086CBCA9B03A8B89406ExchMailbox 2u_
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

I have a column that contains user email addresses. I need to update all em=
ail address in the column that end with [at] cc.edu to [at] ss.edu and retain the i=
nformation (the user name) that exists before the [at] symbol. Is there an upd=
ate query that can edit part of a column record?

Marc


--_000_B0D7C0A3F35FE144A70312D086CBCA9B03A8B89406ExchMailbox 2u_
Content-Type: text/html; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

<html xmlns:v=3D"urn:schemas-microsoft-com:vml" xmlns:o=3D"urn:schemas-micr=
osoft-com:office:office" xmlns:w=3D"urn:schemas-microsoft-com:office:word" =
xmlns=3D"http://www.w3.org/TR/REC-html40">

<head>
<meta http-equiv=3DContent-Type content=3D"text/html; charset=3Dus-ascii">
<meta name=3DGenerator content=3D"Microsoft Word 11 (filtered medium)">
<style>
<!--
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman";}
a:link, span.MsoHyperlink
{color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{color:purple;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:Arial;
color:windowtext;}
[at] page Section1
{size:8.5in 11.0in;
margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
{page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
<o:shapedefaults v:ext=3D"edit" spidmax=3D"1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext=3D"edit">
<o:idmap v:ext=3D"edit" data=3D"1" />
</o:shapelayout></xml><![endif]-->
</head>

<body lang=3DEN-US link=3Dblue vlink=3Dpurple>

<div class=3DSection1>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span style=3D'font-size:1=
0.0pt;
font-family:Arial'>I have a column that contains user email addresses. I ne=
ed
to update all email address in the column that end with [at] cc.edu to [at] ss.edu =
and
retain the information (the user name) that exists before the [at] symbol. Is
there an update query that can edit part of a column record?<o:p></o:p></sp=
an></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span style=3D'font-size:1=
0.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3D"Courier New"><span style=3D'fon=
t-size:10.0pt;
font-family:"Courier New"'>Marc</span></font><o:p></o:p></p>

<p class=3DMsoNormal><font size=3D3 face=3D"Times New Roman"><span style=3D=
'font-size:
12.0pt'><o:p> </o:p></span></font></p>

</div>

</body>

</html>

--_000_B0D7C0A3F35FE144A70312D086CBCA9B03A8B89406ExchMailbox 2u_--
Marc Fromm [ Di, 08 September 2009 18:46 ] [ ID #2015034 ]

Re: update part of a column record

--0015175dd81c3199a1047313d2a3
Content-Type: text/plain; charset=ISO-8859-1

UPDATE table SET column=REPLACE(column,' [at] cc.edu',' [at] somethingelse.com');

change "column" to field name respectively.

On Tue, Sep 8, 2009 at 10:46 AM, Marc Fromm <Marc.Fromm [at] wwu.edu> wrote:

> I have a column that contains user email addresses. I need to update all
> email address in the column that end with [at] cc.edu to [at] ss.edu and retain
> the information (the user name) that exists before the [at] symbol. Is there an
> update query that can edit part of a column record?
>
>
>
> Marc
>
>
>

--0015175dd81c3199a1047313d2a3
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

UPDATE table SET column=3DREPLACE(column,' [at] <a href=3D"http://cc.edu">cc=
..edu</a>',' [at] <a href=3D"http://somethingelse.com">somethingelse.com<=
/a>');<br><br>change "column" to field name respectively.<br>=
<br>
<div class=3D"gmail_quote">On Tue, Sep 8, 2009 at 10:46 AM, Marc Fromm <spa=
n dir=3D"ltr"><<a href=3D"mailto:Marc.Fromm [at] wwu.edu">Marc.Fromm [at] wwu.edu<=
/a>></span> wrote:<br><blockquote class=3D"gmail_quote" style=3D"border-=
left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left=
: 1ex;">









<div link=3D"blue" vlink=3D"purple" lang=3D"EN-US">

<div>

<p><font face=3D"Arial" size=3D"2"><span style=3D"font-size: 10pt; font-fam=
ily: Arial;">I have a column that contains user email addresses. I need
to update all email address in the column that end with [at] <a href=3D"http://=
cc.edu" target=3D"_blank">cc.edu</a> to [at] <a href=3D"http://ss.edu" target=
=3D"_blank">ss.edu</a> and
retain the information (the user name) that exists before the [at] symbol. Is
there an update query that can edit part of a column record?</span></font><=
/p>

<p><font face=3D"Arial" size=3D"2"><span style=3D"font-size: 10pt; font-fam=
ily: Arial;">=A0</span></font></p>

<p><font face=3D"Courier New" size=3D"2"><span style=3D"font-size: 10pt; fo=
nt-family: "Courier New";">Marc</span></font></p>

<p><font face=3D"Times New Roman" size=3D"3"><span style=3D"font-size: 12pt=
;">=A0</span></font></p>

</div>

</div>


</blockquote></div><br><input id=3D"gwProxy" type=3D"hidden"><input onclick=
=3D"jsCall();" id=3D"jsProxy" type=3D"hidden"><div id=3D"refHTML"></div>

--0015175dd81c3199a1047313d2a3--
Aras Angelo [ Di, 08 September 2009 18:54 ] [ ID #2015035 ]
Datenbanken » gmane.comp.db.postgresql.admin » update part of a column record

Vorheriges Thema: partitioning and set statistics
Nächstes Thema: POSTGRES.. NEED HELP