¿ù°£ Àα⠰Խù°

°Ô½Ã¹° 138°Ç
   
[MYSQL] ON DUPLICATE KEY (insert and update)
±Û¾´ÀÌ : ÃÖ°í°ü¸®ÀÚ ³¯Â¥ : 2013-11-12 (È­) 16:25 Á¶È¸ : 10822
±ÛÁÖ¼Ò :
                          

INSERT ¿Í UPDATE ±¸¹®À» ÇÑ°³ÀÇ Äõ¸®¸¦ ÀÌ¿ë
INSERT ½Ã DUPLICATE KEY ¿¡·¯°¡ ¹ß»ýÇϸé UPDATE ¸í·É¾î ¼öÇà



¡Ø INSERT XXX  ON DUPLICATE KEY UPDATE ´Â MySQL 4.1.0 ºÎÅÍ Áö¿øµÇ¸ç ÀÌÇϹöÀü¿¡¼­´Â Áö¿øµÇÁö ¾Ê½À´Ï´Ù.

mysql> insert into TB_TRAFFIC (ymd, ip, octets, gbytes, mbitps) values ( '20131110', 'XXX.XXX.XXX.XXX', '2262700', 0.2 , 1 ) on DUPLICATE KEY update octets='2262700';
ERROR 1064 (HY000): You have an error in your SQL syntax near 'on DUPLICATE KEY update octets='2262700'' at line 1


À̸§ Æнº¿öµå
ºñ¹Ð±Û (üũÇÏ¸é ±Û¾´À̸¸ ³»¿ëÀ» È®ÀÎÇÒ ¼ö ÀÖ½À´Ï´Ù.)
¿ÞÂÊÀÇ ±ÛÀÚ¸¦ ÀÔ·ÂÇϼ¼¿ä.
   

 



 
»çÀÌÆ®¸í : ¸ðÁö¸®³× | ´ëÇ¥ : ÀÌ°æÇö | °³ÀÎÄ¿¹Â´ÏƼ : ·©Å°´åÄÄ ¿î¿µÃ¼Á¦(OS) | °æ±âµµ ¼º³²½Ã ºÐ´ç±¸ | ÀüÀÚ¿ìÆí : mojily°ñ¹ðÀÌchonnom.com Copyright ¨Ï www.chonnom.com www.kyunghyun.net www.mojily.net. All rights reserved.