[英]how to copy column from one table data to another table and insert more columns same time in mysql?
[英]How to copy a row from a table to another table which have more columns than the first one in mysql?
請仔細閱讀我的問題,因為我不善於解釋,請幫助我解決這個問題。
假設我創建了 2 個名為table1
表,它只有 2 列,第二個名為table2
有 3 列,但在 3 列中,2 列與table1
的 2 列相同。
所以我想將table1
的2列中的一行復制到table2
的2列的相同類型,並在mysql中將第3列保留為空。
所以請告訴怎么做。
insert into table2(col1, col2)
select col1, col2 from table1
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.