I am getting this error
Column count doesn’t match value count at row 1
I have a 2 case statments in a MySql Stored Procedure, is it possible that MySql thinks there needs to be a column for each case statement in the table?
Right now the tables have 18 columns, and I have a query that accounts for those 18 columns.
The IMAGE_URL column is only 1 column.
, CASE WHEN IM.DIVISION IN ('C4', 'J3') THEN
CONCAT(VAR_STORE_URL,VAR_IMAGE_URL,IM.EDPNO,'.jpg') END AS IMAGE_URL
, CASE WHEN IM.DIVISION = '30' THEN
(Select PM.imgUrl FROM stage_product_data.product_match PM
WHERE PM.itemno = IM.ITEMNO) END AS IMAGE_URL
You’re (possibly) unintentionally creating two columns here, when based on name it appears like you only wanted one. (They’re both named
IMAGE_URL.)I’d suspect what you wanted was a multiple case: