Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Update query

Status
Not open for further replies.

dagoat10

Programmer
Joined
Jun 3, 2010
Messages
74
Location
US
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?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top