当前位置:网站首页>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';
边栏推荐
- 纹理增强
- Ecological escort cloud service providers wave "Intel flag"
- [practical series] full WiFi coverage at home
- Syntax highlighting of rich text
- 欢迎来到联想智能大屏的新世界
- Linux64Bit下安装MySQL5.6-不能修改root密码
- The latest QQ wechat domain name anti red PHP program source code + forced jump to open
- C语言边界计算和不对称边界
- 图片旋转移动缩放渐变
- I'd like to ask how to open an account at industrial securities? Is it safe to open a stock account through the link
猜你喜欢
随机推荐
Lenovo tongfuyao: 11 times the general trend, we attacked the city and pulled out the stronghold all the way
指南针炒股软件怎么样?安全吗?
Heavyweight: the domestic ide was released, developed by Alibaba, and is completely open source! (high performance + high customization)
Scala IO reads by lexical units and numbers
LLVM TargetPassConfig
4 years of working experience, and you can't tell the five communication modes between multithreads. Can you believe it?
Why does Dell always refuse to push the ultra-thin commercial notebook to the extreme?
生态护航 云服务商挥起“英特尔大旗”
欢迎来到联想智能大屏的新世界
音频PCM数据计算声音分贝值,实现简单VAD功能
Leetcode 1248. Statistics of "graceful subarray" (harm, suddenly found that it can only enumerate violently)
Using bindservice method to pause music playing
Bi-sql delete
粉丝福利,JVM 手册(包含 PDF)
QT (36) -rapidjson parsing nested JSON
Text editor for QT project practice - Episode 12
Bi-sql like
腾讯云WeCity解决方案
Bi-sql - different join
Tencent moved!









