adding data in one column

Started by Robert Kernellover 25 years ago4 messagesgeneral
Jump to latest
#1Robert Kernell
kernell@sundog.larc.nasa.gov

Hello.

Suppose I have a table with data in it. Then I add a column. Now I want to add
data to that column, in the rows that are already there. So I want to go to each
row and add data to the new column in that row.

How can I do this?

Thank you.

Bob Kernell
Research Scientist
Surface Validation Group
AS&M, Inc.
email: kernell@sundog.larc.nasa.gov
tel: 757-827-4631

#2Adam Lang
aalang@rutgersinsurance.com
In reply to: Robert Kernell (#1)
Re: adding data in one column

It matters. Is the data you're inputting relevant to the rest of the
information in the row, or are you just putting in all the same info in that
column?

Adam Lang
Systems Engineer
Rutgers Casualty Insurance Company
----- Original Message -----
From: "Robert Kernell" <kernell@sundog.larc.nasa.gov>
To: <pgsql-general@postgresql.org>
Sent: Friday, October 06, 2000 9:43 AM
Subject: [GENERAL] adding data in one column

Hello.

Suppose I have a table with data in it. Then I add a column. Now I want to

add

data to that column, in the rows that are already there. So I want to go

to each

Show quoted text

row and add data to the new column in that row.

How can I do this?

Thank you.

Bob Kernell
Research Scientist
Surface Validation Group
AS&M, Inc.
email: kernell@sundog.larc.nasa.gov
tel: 757-827-4631

#3Brett W. McCoy
bmccoy@chapelperilous.net
In reply to: Robert Kernell (#1)
Re: adding data in one column

On Fri, 6 Oct 2000, Robert Kernell wrote:

Suppose I have a table with data in it. Then I add a column. Now I want to add
data to that column, in the rows that are already there. So I want to go to each
row and add data to the new column in that row.

UPDATE <tablename> SET <newcolname>=<DATA> [WHERE CLAUSE]

Brett W. McCoy
http://www.chapelperilous.net
---------------------------------------------------------------------------
A candidate is a person who gets money from the rich and votes from the
poor to protect them from each other.

#4Peter Eisentraut
peter_e@gmx.net
In reply to: Robert Kernell (#1)
Re: adding data in one column

Robert Kernell writes:

Suppose I have a table with data in it. Then I add a column. Now I want to add
data to that column, in the rows that are already there. So I want to go to each
row and add data to the new column in that row.

UPDATE table SET newcolumn = 'data';

--
Peter Eisentraut peter_e@gmx.net http://yi.org/peter-e/