Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
需要用超过 80k 条目填充数据库。所以,我正在选择我现有的数据库并将 1 附加到 id(主键)。这不起作用,请帮忙。
INSERT INTO `products`(`id`, `Code`, `Product_name`, `Pack`, `MRP`, `VPTR`) VALUES( SELECT( CONCAT(`id`,'1') , `Code`, `Product_name`, `Pack`, `MRP`, `VPTR`) FROM `products`)
插入SELECTed 数据集时,不要使用VALUES关键字。你的陈述应该是:
SELECT
VALUES
INSERT INTO `products`(`id`, `Code`, `Product_name`, `Pack`, `MRP`, `VPTR`) SELECT CONCAT(`id`,'1') , `Code`, `Product_name`, `Pack`, `MRP`, `VPTR` FROM `products`