当前位置:网站首页>MySQL gets the primary key and table structure of the table
MySQL gets the primary key and table structure of the table
2022-06-25 01:15:00 【wcdunf】
-- Get the primary key of all tables or specified tables
SELECT
k.column_name,
t.table_name,
table_schema
FROM
information_schema.table_constraints t
JOIN information_schema.key_column_usage k USING ( constraint_name, table_schema, table_name )
WHERE
t.constraint_type = 'PRIMARY KEY'
AND t.table_schema = DATABASE ()
AND t.table_name = 'sys_menu';
-- Get table structure
SELECT
table_schema,
table_name,
column_name,
column_type,
column_key,
is_nullable,
column_default,
column_comment,
character_set_name
FROM
information_schema.COLUMNS
WHERE
table_schema = DATABASE ()
AND table_name = 'qrtz_blob_triggers';
边栏推荐
- Distinguish between i++ and ++i seconds
- vb学习什么[通俗易懂]
- 2022 melting welding and thermal cutting recurrent training question bank simulated examination platform operation
- Preliminary understanding of qtoolbutton
- MySQL common basic statements (collation)
- How much commission does CICC wealth securities open an account? Is stock account opening and trading safe and reliable?
- 108 pages (40000 words) proposal for future apartment intelligent design platform project (version 2022)
- Scala IO reads by lexical units and numbers
- Scala IO read by line
- 1. 封装自己的脚手架 2.创建代码模块
猜你喜欢

QT (35) - operate excel qxlsx qaxobject

Using macro code to generate handwriting automatically in word or WPS

108 pages (40000 words) proposal for future apartment intelligent design platform project (version 2022)

2022 simulated 100 questions of safety officer-c certificate examination and online simulated examination

Scala IO read by line

QT electronic clock

Bi-sql select into

Première application de l'informatique quantique à la modélisation des flux de puissance dans les systèmes énergétiques à l'Université technique danoise

天书夜读笔记——深入虚函数virtual

Text editor of QT project practice ---------- episode 11
随机推荐
这个国庆!腾讯云WeCity陪您一同出行,点亮城市地标...
ContentResolver,拿到手机短信内容
Text editor for QT project practice - Episode 12
归并排序求逆序数
Introduction to smart contract security audit delegatecall (2)
Tencent has completed the comprehensive cloud launch to build the largest cloud native practice in China
Scala object blending trait
Using macro code to generate handwriting automatically in word or WPS
How to store dataframe data in pandas into MySQL
The latest QQ wechat domain name anti red PHP program source code + forced jump to open
Syntax highlighting of rich text
Scala template method pattern
2022 crane driver (limited to bridge crane) examination question bank simulated examination platform operation
2022 melting welding and thermal cutting recurrent training question bank simulated examination platform operation
腾讯云WeCity解决方案
Assembly language (3) 16 bit assembly basic framework and addition and subtraction loop
利用 Redis 的 sorted set 做每周热评的功能
Bi-sql - different join
4年工作经验,多线程间的5种通信方式都说不出来,你敢信?
网上开户选哪个证券公司?网上开户安全么?