MySQL view column information in a table

Source: Internet
Author: User
Tags mysql view

View database and table names for all tables in all databases

SELECT '   TABLES '. ' Table_schema ', ' TABLES '. ' table_name 'from  ' information_schema '. ' TABLES ' 
View the database name and table name of all the base tables in all databases

SELECT '   TABLES '. ' Table_schema ', ' TABLES '. ' table_name 'from  ' information_schema '. ' TABLES 'WHERE  ='base table';

View all column information in the T1 table in the Test1 database

where order by ' ordinal_position ' refers to the order of the original columns in the table

  SELECT *  from    where ' table_schema ' = ' test1 ' and '    table_name '='t1'order by ' Ordinal_ POSITION ';

View table names and column names in all tables in the Test1 database

SELECT DISTINCT Table_name,column_name  from   where ' table_schema ' = ' test1 ';   

MySQL view column information in a table

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.