Webbo_1980
asked on
How do i move a field and its contents to a different table?
I have two tables e.g. Product and ProductNew both are linked via a foreign key call ProductId
However i want to merge the tables into one table?
What the sql for this please?
THanks
Webbo
However i want to merge the tables into one table?
What the sql for this please?
THanks
Webbo
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Joe obviously has the solution.
But then you just wanted to update data, not create a table or a new field. subtitle already exists in Product and you just want to fill in new data.
If you really wanted to add a field to Product, this isn't possible with INTO your SQL would work if no table Prudct would exist it would create one, but ONLY with the subtitle field, that surely is not what you want.
When you initially said you wanted to merge two tables, I thought of merging table structures in the first place, not merging data.
Bye, Olaf.
But then you just wanted to update data, not create a table or a new field. subtitle already exists in Product and you just want to fill in new data.
If you really wanted to add a field to Product, this isn't possible with INTO your SQL would work if no table Prudct would exist it would create one, but ONLY with the subtitle field, that surely is not what you want.
When you initially said you wanted to merge two tables, I thought of merging table structures in the first place, not merging data.
Bye, Olaf.
ASKER
Sorry Olaf it was a poor choce of words on my part
ASKER
I have a table called Product and ProductEx
I want to merge then to be Product
ProductEx Contains subtitle and a foreign key called ProductId
SELECT subtitle INTO Product
FROM Product t1 Full Outer Join Productex t2 On t1.ProductID =t2.ProductID
Is this correct?