Fix “ERROR 3942 (HY000): Each row of a VALUES clause must have at least one column” when using the VALUES Statement in MySQL

If you’re getting an error that reads “ERROR 3942 (HY000): Each row of a VALUES clause must have at least one column” in MySQL, you could have an empty row constructor when using the VALUES statement.

To fix this issue, make sure you’ve got at least one value in each ROW() clause within the VALUES statement.

Continue reading

Fix “ERROR 1136 (21S01): Column count doesn’t match value count at row 2” when using the VALUES Statement in MySQL

If you’re getting an error that reads something like “ERROR 1136 (21S01): Column count doesn’t match value count at row 2” when using the VALUES statement in MySQL, it’s probably because there’s a mismatch in the number of columns specified in the ROW() clauses.

To fix this error, be sure that all ROW() clauses contain exactly the same number of columns.

Continue reading