小编Cit*_*ols的帖子

sqlfiddle中的错误或者我不明白INSERT ... ON DUPLICATE KEY UPDATE

这个sqlfiddle链接似乎在调用期间保持状态:http://sqlfiddle.com/#!2/125bc/1

它包含mysql的这个模式:

CREATE TABLE if not exists  `standings` (
  `teamid` int(11) NOT NULL,
  `win` decimal(23,0) default NULL,
  `tie` decimal(23,0) default NULL,
  `lose` decimal(23,0) default NULL,
  PRIMARY KEY  (`teamid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;


INSERT INTO `standings` (`teamid`, `win`, `tie`, `lose`) VALUES
(1, 3, 0, 0),
(2, 1, 1, 1),
(3, 1, 1, 1),
(4, 0, 0, 3);


CREATE TABLE if not exists `newscores` (
  `recordid` int(11) NOT NULL auto_increment,
  `teamid` int(11) NOT NULL,
  `gameid` int(11) NOT NULL,
  `totalstrokes` int(11) …
Run Code Online (Sandbox Code Playgroud)

mysql sql sqlfiddle

2
推荐指数
1
解决办法
2435
查看次数

标签 统计

mysql ×1

sql ×1

sqlfiddle ×1