MySQL SQL Collections
时间:2010-03-17 来源:xylonw
插入数据重复,更新其他的列;
INSERT INTO TABLE_NAME(CLUOMN,...) VALUES(...) ON DUPLICATE KEY UPDATE SET CLUMON = NEW_VALUE, CLUMON = NEW_VALUE;
join UPDATE:
UPDATE HO_User_Soho_Team A LEFT JOIN HO_User_Soho_VIP_Team B ON A.`TeamID` = B.`TeamID` SET A.`TeamState` = '0' WHERE B.`UserID`= "+userID
join DELETE:
DELETE A FROM [SH_ClosingBalance] A LEFT JOIN [SH_StoreHouse] B ON A.StoreHouseID=B.ID
WHERE B.departmentID='1000'
相关阅读 更多 +