I am trying to insert ID field from one table to another using below query:
INSERT INTO `srikprag_db`.`acbalance`
SELECT `id` FROM `srikprag_mlm`.`member_table`
Error is showing:
#1136 - Column count doesn't match value count at row 1
What is the reason for this error?
You did not define the destination column on where the values from the SELECT
statement will be saved, eg.
INSERT INTO srikprag_db.acbalance (ID) -- <<== destination column
SELECT id
FROM srikprag_mlm.member_table
probably you want to manipulate records across database.
SELECT `id` FROM `srikprag_mlm`.`member_table`
returns a result set with only 1 column ( id
).
The acbalance
table probably has more than 1 column.
The problem is with your query you are not assigning any value to the column. You have 1 column with zero value.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.