I'm trying to insert values from two tables into a new table, but I keep getting the 'column count does not match' when it does. This is what I have so far:
create table contribution (
contb_id integer primary key auto_increment,
cand_id varchar(12),
contbr_id varchar(12),
amount numeric(8,2),
date varchar(20),
election_type varchar(20),
tran_id varchar(20),
foreign key (cand_id) references candidate,
foreign key (contbr_id) references contributor
);
and to insert the values into it:
INSERT INTO contribution (cand_id, contbr_id, amount, date, election_type, tran_id)
SELECT (cand_id, cb.contbr_id, contb_receipt_amt, contb_receipt_dt, election_tp, tran_id)
FROM campaign, contributor cb
Any help would be greatly appreciated!