Adding a new Column from a separate Table...
| User, date | Message |
|---|---|
|
Written by Ash501
1 year ago Category: General 21 posts since Tue, 20 Mar 12 |
Is there an easy way to merge data from one table to another? Need to ADD a 'whole' Column from a one Table into different one. They both have a common ID. Is there an easy way to do it with HeidiSQL? How about a 'part' of the Column only? Thanks for your help! |
|
Written by ansgar
1 year ago 3973 posts since Fri, 07 Apr 06 |
You need to create the column name/type first in the target table. Then you can select col from table1 into table2 While that does not update anything, but inserts, of course. |
|
Written by ansgar
1 year ago 3973 posts since Fri, 07 Apr 06 |
oh, it's too early in the morning. I meant: insert into table2 (col) select col from table1 |
|
Written by Ash501
1 year ago 21 posts since Tue, 20 Mar 12 |
This inserts into end of records. Need to update into current records.../or empty column...so that it would be alongside current records. Is that what you mean by update? How is that done? Sorry I'm new to SQL.... Thanks anse! |
|
Written by ansgar
1 year ago 3973 posts since Fri, 07 Apr 06 |
In that case you will need an equal identifier column in both tables (let's call it "someuniquekey"): UPDATE |
|
Written by Ash501
1 year ago 21 posts since Tue, 20 Mar 12 |
Thanks anse!!! Just what I needed, a happy camper ={:-)) & you make it look so easy.... |
|
Please login to leave a reply, or register at first. |