Results 1 to 2 of 2

Thread: mysql: show every column in the database

  1. #1
    Join Date
    Mar 2007
    Posts
    2

    Smile mysql: show every column in the database

    I'm looking for a column in the database and rather than dig through 50 tables i was wondering if there was a *magical* query that could do the trick.

    Something to the effect of
    select * from (show tables) limit 1;

    i saw some where to try an use the table "Syscolumns" but i get an error:
    table db.Syscolumns doesn't exist

    any suggestions?

    thanks

  2. #2
    Join Date
    Mar 2007
    Posts
    2
    hah, figured it out
    SELECT
    column_name
    FROM
    information_schema.`COLUMNS` C
    where
    table_schema = 'mysql'
    and
    column_name = 'whatever' #or kill this for all

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •