I am trying to update one column of a table from another column of another table, but i keep getting errors
here is what i have tried:
mysql> Update NFL_Players2
-> SET Number = Player2.Number
-> Where NFL_Players2.Number = Player2.Number;
ERROR 1109: Unknown table 'Player2' in where clause
Also i have tried this:
mysql> Update NFL_Players2 INNER JOIN Player2
-> ON Player2.Player = NFL_Players2.Player
-> SET NFL_Players2.Number = Player2.Number
-> WHERE Player2.Player = "Derek Anderson";
ERROR 1064: You have an error in your SQL syntax near 'INNER JOIN Player2
ON Player2.Player = NFL_Players2.Player
SET NFL_Players2.Numb' at line 1
All the necessary tables exist, so what is missing?
here is what i have tried:
mysql> Update NFL_Players2
-> SET Number = Player2.Number
-> Where NFL_Players2.Number = Player2.Number;
ERROR 1109: Unknown table 'Player2' in where clause
Also i have tried this:
mysql> Update NFL_Players2 INNER JOIN Player2
-> ON Player2.Player = NFL_Players2.Player
-> SET NFL_Players2.Number = Player2.Number
-> WHERE Player2.Player = "Derek Anderson";
ERROR 1064: You have an error in your SQL syntax near 'INNER JOIN Player2
ON Player2.Player = NFL_Players2.Player
SET NFL_Players2.Numb' at line 1
All the necessary tables exist, so what is missing?