Update from a table.

From: Andrew Bell <acbell(at)iastate(dot)edu>
To: pgsql-novice(at)postgresql(dot)org
Subject: Update from a table.
Date: 2001-11-21 14:02:27
Message-ID: 5.1.0.14.2.20011121075700.00ac4a10@acbell.mail.iastate.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

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(at)iastate(dot)edu

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message König, Frank 2001-11-21 14:15:22 upper and lower doesn't work with german umlaut?
Previous Message Juan Jose Natera Abreu 2001-11-20 20:02:58 Re: Info about DBI::Sybase.