【发布时间】:2017-07-06 13:53:42
【问题描述】:
我正在尝试在我的产品表中插入一些记录,我需要插入没有重复型号代码的产品,我使用查询:
INSERT IGNORE INTO erp_product
(erp_model, erp_ean, erp_cstid, erp_quantity,
erp_brand_erp_brandid, erp_price, erp_cost,
erp_weight, erp_lenght, erp_width, erp_height,
erp_status, erp_distributor, erp_registerdate)
VALUES(
'020-113_24','7897712061589',1,0,
'1','22.85','17.58',
'0.03','13','14','5',
0,'OP','06/07/2017 10:32:47');
我需要使用WHERE NOT IN 或WHERE NOT EXISTS?有什么区别?
插入无效,有什么建议吗?提前致谢!
【问题讨论】:
-
表上存在哪些主键/唯一键?
标签: mysql