Unable to create table in MYSQL #1113 A table must have at least 1 column

3,344 views
Skip to first unread message

Loren

unread,
Mar 18, 2013, 6:46:36 PM3/18/13
to joomla-de...@googlegroups.com

I dont know why I am getting this error, I think this morning i ran this query without errors and it worked.. I am trying to merge two different tables from two different databases under the same user into one table, the tables have the same fields, but different values, and I want a big table with the fields from the 2 merged tables.

I am using:

create table jos_properties_merged engine = MERGE UNION = (db1.jos_xxxx_contacts,db2.jos_xxxxx_contacts);

And i get

"#1113 - A table must have at least 1 column "

DO you know what I am doing wrong, please?

Niels Braczek

unread,
Mar 18, 2013, 11:40:41 PM3/18/13
to joomla-de...@googlegroups.com
Am 18.03.2013 23:46, schrieb Loren:

> create table jos_properties_merged engine = MERGE UNION = (db1.jos_xxxx_contacts,db2.jos_xxxxx_contacts);
>
> And i get
>
> "#1113 - A table must have at least 1 column "
>
> DO you know what I am doing wrong, please?

You need to specify the columns for jos_properties_merged. See
http://dev.mysql.com/doc/refman/5.5/en/merge-storage-engine.html for an
example.

Regards,
Niels

--
| http://barcamp-wk.de · 3. Barcamp Westküste · Frühjahr 2014 |
| http://www.bsds.de · BSDS Braczek Software- und DatenSysteme |
| Webdesign · Webhosting · e-Commerce · Joomla! Content Management |
------------------------------------------------------------------

Loren

unread,
Mar 19, 2013, 8:54:40 AM3/19/13
to joomla-de...@googlegroups.com
well, not really, I am using this now:


create table students_merged as select * from db1.students_contacts; insert ignore into students_merged select * from db2.students_contacts;

thanks in advance for your help, please is there any way to include in the above query a order by field (date) when merging the tables and also a way to run this query only to update the merged tables with new records from the other two tables? please help me, thank you so much.
Reply all
Reply to author
Forward
0 new messages