mysql copy column data type to another table
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: Is there a way to copy a column's structure from an already populated table to a new table which is empty? I'm only asking about copying the structure without the data Example: We have a table CREATE TABLE `animals` ( `animal` varchar ( 11 ) NOT NULL , `food` varchar ( 11 ) NOT NULL , PRIMARY KEY ( `animal` ) ) ENGINE = InnoDB INSERT INTO `animals` ( `animal` , `food` ) VALUES ( 'cat' , 'chips' ), ( 'dog' , 'bones' ), ( 'shark' , 'ppl' ); And a new table called predators for which I want to make just one column but with the same