Re: Update from a table.
От | Mark G. Franz |
---|---|
Тема | Re: Update from a table. |
Дата | |
Msg-id | 000701c17431$55383110$6a01a8c0@mgflaptop обсуждение исходный текст |
Ответ на | Update from a table. (Andrew Bell <acbell@iastate.edu>) |
Ответы |
Re: Update from a table.
Re: Update from a table. |
Список | pgsql-novice |
Last I checked, you cannot perform arithmetic functions inside a query. I suggest retrieving the values, do the math, then update. Mark ----- Original Message ----- From: "Andrew Bell" <acbell@iastate.edu> To: <pgsql-novice@postgresql.org> Sent: 21 November, 2001 6:02 AM Subject: [NOVICE] Update from a table. > Hi, > > I want to update one table from another table based on a criteria. For > instance: > > table1 table2 > employee | salary | netSalary employee | deductions > > I want to update table1.netSalary to be table1.salary - table2.deductions where > table1.employee = table2.employee. > > I don't see any way to do something like this with the syntax. What am I > missing, or what can be recommended? > > > -- Andrew Bell > acbell@iastate.edu > > > > ---------------------------(end of broadcast)--------------------------- > TIP 5: Have you checked our extensive FAQ? > > http://www.postgresql.org/users-lounge/docs/faq.html >
В списке pgsql-novice по дате отправления: