L
L
lawyer_of_a_devil2014-07-01 11:01:08
MySQL
lawyer_of_a_devil, 2014-07-01 11:01:08

How to copy the structure of some fields from one table to another (MySQL)?

There are 2 tables, they have, respectively, different structures.
Foreign keys and indexes are missing.
The tables are empty.
How can I export part of the fields from one table to another?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Mykola, 2014-07-01
@iSensetivity

stackoverflow.com/questions/1834472/copy-table-wit...

Try:

CREATE TABLE foo SELECT * FROM bar LIMIT 0
Or:

CREATE TABLE foo SELECT * FROM bar WHERE 1=0

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question