Thread: 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
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
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
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.
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/