Query of annotation information in corresponding database table of MySQL database query and query of added fields

Source: Internet
Author: User
Tags mysql query

SELECT * from information_schema.columns where table_schema = ' db ' #表所在数据库 and table_name = ' tablename '; #你要查的表

In addition to the above method can also add field query

Log in to the database using Mysql-uyourroot-pyourpassword

Use the database again;

You can include the comment information in the MySQL query table that corresponds to the row in the field

Where ' wh_bu_order_relation ' is the database table name (you can query other tables Wh_bu_work_order, wh_bu_event)

Where the ' order_relation_id ' database queries the field names (you can query other fields Apply_code, Work_order_code, etc.)

Mysql> select* from Information_schema.columns where table_name= ' wh_bu_order_relation ' and Column_name= ' Order_ Relation_id ';

+---------------+---------------+----------------------+-------------------+------------------+---------------- +-------------+-----------+--------------------------+------------------------+-------------------+------------ ---+--------------------+-----------------+-------------+------------+-------+--------------------------------- +-----------------------+

| Table_catalog | Table_schema | table_name | column_name | ordinal_position | Column_default |is_nullable | Data_type | Character_maximum_length | Character_octet_length | numeric_precision | Numeric_scale | Character_set_name | Collation_name | Column_type | Column_key | EXTRA | privileges | column_comment |

+---------------+---------------+----------------------+-------------------+------------------+---------------- +-------------+-----------+--------------------------+------------------------+-------------------+------------ ---+--------------------+-----------------+-------------+------------+-------+--------------------------------- +-----------------------+

| NULL | Whitehole | wh_bu_order_relation | order_relation_id| 1 | NULL | NO | varchar | 36 | 108 | NULL | NULL | UTF8 | Utf8_general_ci | varchar (36) | PRI | | select,insert,update,references | Application single-Relationship primary key |

| NULL | Whitehole_dev | wh_bu_order_relation | order_relation_id | 1 | NULL | NO | varchar | 36 | 108 | NULL | NULL | UTF8 | Utf8_general_ci | varchar (36) | PRI | | select,insert,update,references | Application single-Relationship primary key |

+---------------+---------------+----------------------+-------------------+------------------+---------------- +-------------+-----------+--------------------------+------------------------+-------------------+------------ ---+--------------------+-----------------+-------------+------------+-------+--------------------------------- +-----------------------+

2rows in Set (0.00 sec)

Query of annotation information in corresponding database table of MySQL database query and query of added fields

Related Article

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.