Thread: adding data in one column

adding data in one column

From
Robert Kernell
Date:
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


Re: adding data in one column

From
"Adam Lang"
Date:
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
> 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


re: adding data in one column

From
Robert Kernell
Date:
Yes, the data I am adding in the new column depends on the information already
in the row. But now that you mention it, also can you tell me how I would put
the same thing in that column in every row?

Thanx.

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


Re: adding data in one column

From
Date:
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.


Re: adding data in one column

From
Peter Eisentraut
Date:
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/