Skip site navigation (1) Skip section navigation (2)

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: (view raw, whole thread or download thread mbox)
Lists: pgsql-novice

I want to update one table from another table based on a criteria.  For 

            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


pgsql-novice by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group