george Posted March 12, 2012 Share Posted March 12, 2012 I have a table called staff, and I want to change the column JCN_RC to a static value. 'MY53', if the table AVTeam has a record corresponding record. By corresponding record, I mean that there exists a record in AVTeam. If it exists, the emplid value in the Staff table is equil to the emplid in the second table, AVTeam. I tried this, UPDATE Staff s, AVTeam p SET s.JCN_RC = 'MY55' WHERE s.EMPLID = p.EMPLID Suggestions?Thanks Link to comment Share on other sites More sharing options...
justsomeguy Posted March 12, 2012 Share Posted March 12, 2012 UPDATE Staff SET JCN_RC = 'MY55' WHERE EMPLID IN (SELECT EMPLID FROM AVTeam) Link to comment Share on other sites More sharing options...
george Posted March 12, 2012 Author Share Posted March 12, 2012 Thanks JSG - This SQL gives me a message that says: Affected rows: 0. But there are records in AVTeam which are also in table Staff. Link to comment Share on other sites More sharing options...
justsomeguy Posted March 12, 2012 Share Posted March 12, 2012 They might already have the correct values, they don't get updated if the value doesn't change. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.