2014-07-13 16:28:28
来 源
中存储网
MySQL
INSERT INTOkeyword_srch_CNT_TOP_100_MONTH_20130301190944(CGI,ACCESS,IP,REF,UA,HIT)VALUES('getlogcollect.cgi','2013-03-0100:00:00',
INSERT  INTO keyword_srch_CNT_TOP_100_MONTH_20130301190944(CGI,ACCESS,IP,REF,UA,HIT) VALUES
('getlogcollect.cgi','2013-03-01 00:00:00','172.26.176.95','','Firefox','100')
,
('navisearchif7.cgi','2013-03-01 00:00:00','172.26.176.95','','Firefox','200'),
('navisearchif7.cgi','2013-03-01 00:00:00','172.26.176.95','','Firefox','200'),
('navisearchif7.cgi','2013-03-01 00:00:00','172.26.176.95','','Firefox','200'),
('navisearchif7.cgi','2013-03-01 00:00:00','172.26.176.95','','Firefox','200'),
('keywordmap.cgi','2013-03-01 00:00:00','172.26.176.95','','Firefox','2918')
ON DUPLICATE KEY UPDATE ACCESS=ACCESS, datacnt=datacnt+1

遇到一个问题当表中有一个字段是日期类型时用 ON DUPLICATE KEY UPDATE 做更新的数据时日期会变掉,最后把
ON DUPLICATE KEY UPDATE ACCESS=ACCESS, datacnt=datacnt+1 加上解决了

声明: 此文观点不代表本站立场;转载须要保留原文链接;版权疑问请联系我们。