我有这三个表:
用户
游戏
IsPlaying模块
如果密钥存在,您也应该这样做然后更新。然后唯一的值被称为:
该表必须正在播放才能更新或插入。
User.ID_Facebook = 2131234
Game.Name =“游戏名称”
IsPlaying.Time_UP =“0000-00-00 00:00:00”
示例SQL(不起作用)
INSERT INTO isplaying (ID_User, ID_Game, Time_UP)
VALUES((SELECT ID FROM User WHERE ID_FACEBOOK=2131234), (SELECT ID FROM Game WHERE Name="Name of the game"), "2016-05-18 00:00:00")
ON DUPLICATE KEY UPDATE ID_Game=, Time_UP="2016-05-18 00:00:00"
答案 0 :(得分:1)
im2