[英]MYSQL insert into table select id as NULL, * from temp_tbl
我想從臨時表中選擇所有內容,然后將結果的ID設置為NULL,以便可以將此記錄插入如下表中:
insert into product select NULL as id, * from tmp_tb
但是此查詢不起作用。 請給我一個想法,如何正確地做到這一點。 提前致謝!
嘗試這個 ;)
INSERT INTO product SELECT NULL, tmp_tb.* FROM tmp_tb;
嘗試這個:
insert into product select NULL, col2, col3, ..., colN from tmp_tb
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.