Well, yes, the title says it all.
SELECT * FROM (SHOW TABLES) AS my_tables
Something along these lines, though the above does not work (on 5.0.51a, at least).
Well, yes, the title says it all.
SELECT * FROM (SHOW TABLES) AS my_tables
Something along these lines, though the above does not work (on 5.0.51a, at least).
Have you looked into querying INFORMATION_SCHEMA.Tables? As in
SELECT ic.Table_Name, ic.Column_Name, ic.data_Type, isnull(Character_Maximum_Length,'') Max, ic.Numeric_precision as Precision, ic.numeric_scale as Scale, ic.Character_Maximum_Length as VarCharSize, ic.is_nullable as Nulls, ic.ordinal_position as OrdinalPos, ic.column_default as ColDefault, ic.autoinc_next as Next, ku.ordinal_position as PK, kcu.constraint_name,kcu.ordinal_position, tc.constraint_type
FROM INFORMATION_SCHEMA.COLUMNS ic
left outer join INFORMATION_SCHEMA.key_column_usage ku on ku.table_name = ic.table_name and ku.column_name = ic.column_name
left outer join information_schema.key_column_usage kcu on kcu.column_name = ic.column_name and kcu.table_name = ic.table_name
left outer join information_schema.table_constraints tc on kcu.constraint_name = tc.constraint_name
order by ic.table_name, ic.ordinal_position;
I think you want SELECT * FROM INFORMATION_SCHEMA.TABLES
See http://dev.mysql.com/doc/refman/5.0/en/tables-table.html
I think what you want is MySQL's information_schema view(s): http://dev.mysql.com/doc/refman/5.0/en/tables-table.html
SELECT * FROM INFORMATION_SCHEMA.TABLES
That should be a good start. For more, check INFORMATION_SCHEMA Tables.
I don't understand why you want to use SELECT * FROM as part of the statement.
Not that I know of, unless you select from INFORMATION_SCHEMA, as others have mentioned. However, the SHOW command is pretty flexible, e.g.:
SHOW tables like '%s%'