Updating Query of 1 table from data in another - Mailing list pgsql-sql

From Chris Preston
Subject Updating Query of 1 table from data in another
Date
Msg-id 200810131923.m9DJN2Dh005486@mail2.trafalgar.lan
Whole thread Raw
Responses Re: Updating Query of 1 table from data in another
List pgsql-sql
<div class="Section1"><p class="MsoNormal"><font face="Arial" size="2"><span style="font-size:10.0pt;
font-family:Arial">Hello all, I’m still new to postgres</span></font><p class="MsoNormal"><font face="Arial"
size="2"><spanstyle="font-size:10.0pt; 
font-family:Arial">If I have 2 tables with the following data structure</span></font><p class="MsoNormal"><font
face="Arial"size="2"><span style="font-size:10.0pt; 
font-family:Arial"> </span></font><p class="MsoNormal"><font face="Arial" size="2"><span style="font-size:10.0pt;
font-family:Arial">Agentno and agentname (along with many other fields) this table is called
agent_master</span></font><pclass="MsoNormal"><font face="Arial" size="2"><span style="font-size:10.0pt; 
font-family:Arial"> </span></font><p class="MsoNormal"><font face="Arial" size="2"><span style="font-size:10.0pt;
font-family:Arial">And I have another table with agentno and agentname. Table called updatetable</span></font><p
class="MsoNormal"><fontface="Arial" size="2"><span style="font-size:10.0pt; 
font-family:Arial"> </span></font><p class="MsoNormal"><font face="Arial" size="2"><span style="font-size:10.0pt;
font-family:Arial">When I add data in the updatetable, I want to write a query that will enter the agentname field in
thecorresponding agent_master.agentname field based on agent_master.agentno = updatetable.agentno</span></font><p
class="MsoNormal"><fontface="Arial" size="2"><span style="font-size:10.0pt; 
font-family:Arial"> </span></font><p class="MsoNormal"><font face="Arial" size="2"><span style="font-size:10.0pt;
font-family:Arial">Thanks in advance</span></font><p class="MsoNormal"><font face="Arial" size="2"><span
style="font-size:10.0pt;
font-family:Arial"> </span></font><p class="MsoNormal"><font face="Arial" size="2"><span style="font-size:10.0pt;
font-family:Arial"> </span></font></div>

pgsql-sql by date:

Previous
From: aklaver@comcast.net (Adrian Klaver)
Date:
Subject: Re: Order of trigger execution: AFTER DELETE ON EACH ROW doesn't appear to be working properly
Next
From: "Scott Marlowe"
Date:
Subject: Re: Updating Query of 1 table from data in another