I'm changing my database structure and I want to do the following thing: I have one table for registered users that holds almost all the information about my site users. There is also one other table that holds information about the amount of points each user have. It has only two columns: user id and points. I want to move the points column in main users table so that the points aren't lost. I know theoretically that I have to join these two colums with user id somehow but I 开发者_如何学运维can't guess what would the code look like...
Hope I'm clear.
Can anyone please help?
First, you will have to add the two column names to the structure of the first table... then do a correlated updates something like
UPDATE YourTable, YourOtherTable
SET
YourTable.Points = YourOtherTable.Points,
YourTable.PointsCol2 = YourOtherTable.PointsCol2
WHERE
YourTable.id = YourOtherTable.id
精彩评论