我有这个问题:
SELECT Stops_edited_small1.AtcoCode, ABC.Naptan_Atco, ABC.Stop_Code
FROM Stops_edited_small1
INNER JOIN ABC
ON Stops_edited_small1.AtcoCode=ABC.Naptan_Atco
返回一个不错的结果表,但我真正想做的是,如果:
Stops_edited_small1.AtcoCode=ABC.Naptan_Atco
我想将ABC.Stop_Code中的数据放入Stops_edited_small1.ABCStop_Code(目前没有值)。
非常感谢。
答案 0 :(得分:3)
UPDATE Stops_edited_small1
SET Stops_edited_small1.ABCStop_Code = ABC.StopCode
FROM Stops_edited_small1
INNER JOIN ABC ON Stops_edited_small1.AtcoCode = ABC.Naptan_Atco