Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Pgsql General > Update Join ?
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 1 Topic 15131 of 17600
Post > Topic >>

Update Join ?

by kevin@[EMAIL PROTECTED] (kevin kempter) Apr 1, 2008 at 03:51 PM

--Apple-Mail-2--1001259929
Content-Type: text/plain;
	charset=US-ASCII;
	format=flowed;
	delsp=yes
Content-Transfer-Encoding: 7bit

Hi List;

Does Postgres allow updates based on the context of a sub-query,  
something like the sample below ?



1) Insert data (real_tab.keyID and real_tab.data_desc)  into a temp  
table (temp_tab)

2) update real_tab
        set real_tab.data_desc = temp_tab.data_desc
       join real_tab on real_tab.keyID = temp_tab.keyID ;

Thanks in advance..



--Apple-Mail-2--1001259929
Content-Type: text/html;
	charset=US-ASCII
Content-Transfer-Encoding: quoted-printable

<html><body style=3D"word-wrap: break-word; -webkit-nbsp-mode: space; =
-webkit-line-break: after-white-space; ">Hi =
List;<div><br></div><div>Does Postgres allow updates based on the =
context of a sub-query, something like the sample below =
?</div><div><br></div><div><font color=3D"#1F497D"><font size=3D"4"><font
=
face=3D"Calibri, Verdana, Helvetica, Arial"><span =
style=3D"font-size:11pt"><i><br>
</i> <br></span></font></font></font></div><div><font =
color=3D"#1F497D"><font size=3D"4"><font face=3D"Calibri, Verdana, =
Helvetica, Arial"><span style=3D"font-size:11pt">1) Insert data =
(real_tab.keyID and real_tab.data_desc) &nbsp;into a temp table =
(temp_tab)</span></font></font></font></div><div><font =
class=3D"Apple-style-span" color=3D"#1F497D" face=3D"Calibri" =
size=3D"4"><span class=3D"Apple-style-span" style=3D"font-size: =
15px;"><br></span></font></div><div><font color=3D"#1F497D"><font =
size=3D"4"><font face=3D"Calibri, Verdana, Helvetica, Arial"><span =
style=3D"font-size:11pt">2) update =
real_tab&nbsp;</span></font></font></font></div><div><font =
color=3D"#1F497D"><font size=3D"4"><font face=3D"Calibri, Verdana, =
Helvetica, Arial"><span style=3D"font-size:11pt">&nbsp;&nbsp; &nbsp; =
&nbsp; set real_tab.data_desc =3D =
temp_tab.data_desc</span></font></font></font></div><div><font =
color=3D"#1F497D"><font size=3D"4"><font face=3D"Calibri, Verdana, =
Helvetica, Arial"><span style=3D"font-size:11pt">&nbsp;&nbsp; &nbsp; =
&nbsp;join real_tab on real_tab.keyID =3D temp_tab.keyID =
;</span></font></font></font></div><div><font class=3D"Apple-style-span" =
color=3D"#1F497D" face=3D"Calibri" size=3D"4"><span =
class=3D"Apple-style-span" style=3D"font-size: =
15px;"><br></span></font></div><div><font class=3D"Apple-style-span" =
face=3D"Calibri" size=3D"4"><span class=3D"Apple-style-span" =
style=3D"font-size: 15px;"><font class=3D"Apple-style-span" =
color=3D"#050505">Thanks in =
advance..</font></span></font></div><div><font class=3D"Apple-style-span"
=
color=3D"#050505" face=3D"Calibri" size=3D"4"><span =
class=3D"Apple-style-span" style=3D"font-size: =
15px;"><br></span></font></div><div><font class=3D"Apple-style-span" =
color=3D"#050505" face=3D"Calibri" size=3D"4"><span =
class=3D"Apple-style-span" style=3D"font-size: =
15px;"><br></span></font></div></body></html>=

--Apple-Mail-2--1001259929--
 




 1 Posts in Topic:
Update Join ?
kevin@[EMAIL PROTECTED]   2008-04-01 15:51:30 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Mon Dec 1 12:57:13 CST 2008.