I would like to do something like Create table xyz as show fields from test.abc;
Or maybe
Select Field from (show fields from test.abc);
Is this possible ?, can I treat the execution of 'show fields' as a select statement
Thanks,
Neal Katz
Sounds like you want
CREATE TABLE new_table LIKE old_table;
This requires 4.1.1 or newer, however.
The output of SHOW FIELDS cannot be treated as a SELECT statement, unless you write your own program to parse the output. If you were writing your own program, though, it'd be easier to use the output of SHOW CREATE TABLE, change the table name in the output, then execute the resulting statement.
-- Paul DuBois, MySQL Documentation Team Madison, Wisconsin, USA MySQL AB, www.mysql.com
MySQL Users Conference: April 14-16, 2004 http://www.mysql.com/uc2004/
-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]