tags:

views:

24

answers:

1

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?

+2  A: 

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
DRapp
Works fine, thanks :)
Levani