Re: get all the columns on all the tables in information_schema On May 27, 5:39 pm, Jerry Stuckle <jstuck...@attglobal.net> wrote:
> JRough wrote:
> > I am writing this query in PHPAdmin on the information_schema
> > database. I want to get the column names from all the tables. I can
> > figure out how to write the query for one table at a time. To save
> > time I would like to write it on all the tables but when I add tables
> > separated by a comma I get an error.
>
> > tia,
>
> > ----------------SELECT COLUMN_NAME, DATA_TYPE, IS_NULLABLE,
> > COLUMN_DEFAULT
> > FROM INFORMATION_SCHEMA.COLUMNS
> > WHERE table_name = 'table1', 'table2'
> > AND table_schema = 'myDatabase'
>
> ... WHERE table_name IN ('table1', 'table2') ...
>
> --
The SQL doesn't appear to work.I tried it several times and included
the correct database name and table names:
COLUMN_DEFAULT FROM INFORMATION_SCHEMA.COLUMNS WHERE table_name IN (
'Table1', 'Table2'
) AND table_schema = 'MyDatabase'
---------------error------------
MySQL said: Documentation
#1064 - You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use
near 'COLUMN_DEFAULT FROM INFORMATION_SCHEMA.COLUMNS WHERE table_name
IN (
'INTERNAL_' at line 1
tia, |