当前位置:网站首页>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';
边栏推荐
- Which securities company should I choose to open an account online? Is it safe to open an account online?
- Novice, let me show you the "soft test" at one time
- 期望与方差
- Lenovo tongfuyao: 11 times the general trend, we attacked the city and pulled out the stronghold all the way
- vb学习什么[通俗易懂]
- Deep learning LSTM model for stock analysis and prediction
- Syntax highlighting of rich text
- ImageView展示网络图片
- 这个国庆!腾讯云WeCity陪您一同出行,点亮城市地标...
- 汇编语言(4)函数传参
猜你喜欢

Bi-sql like

Text editor of QT project practice ---------- episode 11

QT electronic clock

Cobalt strike installation tutorial

汇编语言(4)函数传参

扎克伯格上手演示四款VR头显原型机,Meta透露元宇宙「家底」

How to store dataframe data in pandas into MySQL

LLVM TargetPassConfig

Text border format and text block of rich text

2022 crane driver (limited to bridge crane) examination question bank simulated examination platform operation
随机推荐
Syntax highlighting of rich text
Scala trait inheritance class
QT (36) -rapidjson parsing nested JSON
丹麥技術大學首創將量子計算應用於能源系統潮流建模
bindservice方法实现音乐播放暂停
Scala trait exercise
4 ans d'expérience de travail, 5 modes de communication Multi - thread ne peuvent pas être décrits, vous osez croire?
卷积与反卷积关系超详细说明及推导(反卷积又称转置卷积、分数步长卷积)
51 single chip microcomputer multi computer communication
Scala object blending trait
Zuckerberg demonstrated four VR head display prototypes, and meta revealed the "family" of metauniverse
Sanic service startup failed
Rich text tables, lists, pictures
天书夜读笔记——反汇编引擎xde32
Examination questions and mock examination for safety management personnel of hazardous chemical business units in 2022
Première application de l'informatique quantique à la modélisation des flux de puissance dans les systèmes énergétiques à l'Université technique danoise
Scala sample object
LLVM TargetPassConfig
扎克伯格上手演示四款VR头显原型机,Meta透露元宇宙「家底」
EVM Brief