我有一张桌子
CREATE TABLE IF NOT EXISTS `b_sale_order_props_value` (
`ID` int(11) NOT NULL AUTO_INCREMENT,
`ORDER_ID` int(11) NOT NULL,
`ORDER_PROPS_ID` int(11) DEFAULT NULL,
`NAME` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`VALUE` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`CODE` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL,
PRIMARY KEY (`ID`),
UNIQUE KEY `IX_SOPV_ORD_PROP_UNI` (`ORDER_ID`,`ORDER_PROPS_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1921 ;
我查询
INSERT INTO `b_sale_order_props_value`
SET `ORDER_ID`=316,
`ORDER_PROPS_ID`=30,
`NAME`='ADDRES',
`VALUE`='Test addres'
ON DUPLICATE KEY UPDATE `NAME`='ADDRES',`VALUE`='Test addres';
返回错误
Duplicate entry '316-30' for key 'IX_SOPV_ORD_PROP_UNI'
如何解决这个问题?