Aug 8, 2003 #1 hugheskbh Programmer Dec 18, 2002 37 US How can I update a column with the values of a different column in sql. I'm trying to populate a column with the values of a separate column. Thanks
How can I update a column with the values of a different column in sql. I'm trying to populate a column with the values of a separate column. Thanks
Aug 8, 2003 #2 jimbopalmer Programmer Jul 20, 2001 2,904 US Update my_table set First_column = Second_column where Some_Condition = 'TRUE' if the second column is in the same table Update First_table set First_column = (select second_column from Second_table where First_table.master_key = Second_table.master_key) is an example where the second column is in a different table I tried to remain child-like, all I acheived was childish. Upvote 0 Downvote
Update my_table set First_column = Second_column where Some_Condition = 'TRUE' if the second column is in the same table Update First_table set First_column = (select second_column from Second_table where First_table.master_key = Second_table.master_key) is an example where the second column is in a different table I tried to remain child-like, all I acheived was childish.
Aug 21, 2003 #3 JimboNWUK Technical User Jan 15, 2003 6 GB I actual fact, if the columns are in the same table there is no need for a WHERE clause, just UPDATE TABLE SET COL1 = COL2 Jim Upvote 0 Downvote
I actual fact, if the columns are in the same table there is no need for a WHERE clause, just UPDATE TABLE SET COL1 = COL2 Jim