Get the App
SLTechnology News&Howtos  ›  Database  › 

The mysql database corresponds to the annotation information in the corresponding database table and how to query the added fields.

Shulou Source: shulou.com Published: 2022-06-01 18:59:31 10月03日 Update

This article mainly tells you briefly about the annotation information in the corresponding table of the mysql database and how to query the added fields. You can check the relevant professional terms on the Internet or find some related books to supplement them. We will not dabble here, so let's go straight to the topic. I hope that the mysql database can bring some practical help to you by referring to the annotation information in the corresponding table of the database and how to query the added fields.

Select * from information_schema.columns where table_schema = 'db' # the database where the table is located and table_name =' tablename'; # the table you want to check

In addition to the above methods, you can also add field queries.

Log in to the database using mysql-uyourroot-pyourpassword

Then use use database; to select the database

You can include the comment information corresponding to the rows in the field in the mysql query table

Where 'WH_BU_ORDER_RELATION' is the name of the database table (you can query other tables WH_BU_WORK_ORDER, WH_BU_EVENT)

The name of the field queried by 'order_relation_id' database (you can query other fields such as 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 | NULL | NULL | utf8 | utf8_general_ci | varchar (36) | PRI | | select,insert,update,references | Primary key of the application form relationship |

| | NULL | whitehole_dev | WH_BU_ORDER_RELATION | order_relation_id | 1 | NULL | NO | varchar | 36 | NULL | NULL | utf8 | utf8_general_ci | varchar (36) | PRI | | select,insert,update,references | Primary key of the application form relationship |

+- -+- -+

2rows in set (0.00 sec)

The mysql database corresponds to the annotated information in the corresponding table and how to query the add fields. Let's stop here. If you want to know about other related issues, you can continue to pay attention to our industry information. Our section will capture some industry news and professional knowledge to share with you every day.

Tags: Data database query field information comment specialty name application form industry expertise subject book content actual location news method terminology section Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Xiaomi Shulou Tech Info Microsoft NVidia Huawei