How to handle this scenario where the funnel
table has fewer columns (or fewer columns that I want to insert) when I need to select more columns from demoTable
?
I get this: Column count doesn't match count row
INSERT INTO funnel
(
id,
visitor,
stage
)
select b_id,
visitor_name,
visitor_stage',
visitor_page,
visitor_time
from demoTable
You can't insert by selection with a mismatching number of fields. Select the fields from the source table that match the ones in the destination table and write the query accordingly:
INSERT INTO funnel (id, visitor, stage)
SELECT b_id, visitor_name, visitor_stage FROM demoTable