Skip to content
Advertisement

MYSQL: Insert with Select not working properly

I can’t seem to debug this issue. I am currently running to set person_id to -1, but also utilize a select statement with this person_id value.

Using this statement, I cannot find any reason online or anywhere on why this does not function:

Result is: ERROR 1136 (21S01): Column count doesn’t match value count at row 1

Logically, this should function. But, I am unable to find out why. After all, the column counts definitely do match..

Any suggestions?

Advertisement

Answer

You seem to be looking for the insert ... select syntax:

Demo on DB Fiddle (courtesy of VBokšić).

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement