I am performing a query in two tables and output it into a temporary table
for further sorting.
The problem is that in one of the tables (TableB), I have an additional id
that I want to be added to the temptable. This id is not present in TableA.
I get this error message when I run the query for TableA (see below):
ERROR 1136: Column count doesn't match value count at row 1

I understand the problem (the number of columns in the query doesn´t match
the ones in the table), but not how to solve it.
Any ideas?

create temporary table temptable

date VARCHAR(40) NOT NULL,
id INT(20) NOT NULL,
heading VARCHAR(255) NOT NULL,
body text NOT NULL,
author VARCHAR(255),
domain VARCHAR(40),
bid INT(20)
);

TableA:
INSERT INTO temptable SELECT
date,id,rubrik,body,auth,domain,(What-do-add-here) FROM tablea ORDER BY aid
DESC;

TableB:
INSERT INTO temptable SELECT date,id,rubrik,body,auth,domain,bid FROM tableb
ORDER BY bid DESC;

Thanks
// Tobias


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to