mysql 如何使用sql查询某一个表的表头

mysql 如何使用sql查询某一个表的表头,第1张

工具/材料:Management Studio。

1、首先在桌面上,点击“Management Studio”图标。

2、之后在该界面中,点击左上角“新建查询”按钮。

3、接着在该界面中,输入查询某一个表的表头sql语句“select column_name from Information_schema.columns where table_Name = 'test2'”。

4、然后在该界面中,点击左上方“执行”按钮。

5、最后在该界面中,显示某一个表的表头内容。

可以用 命令"show PROCEDURE status"查看所有的存储过程或检索系统表"mysql.proc"来查询已有的存储过程。

例如:

用show PROCEDURE status命令查看:

-- 查看所有的存储过程

show PROCEDURE status

-- 查看特定数据库存储过程

show PROCEDURE status where db='test'

-- 用指定的登录名查看该用户创建的存储过程

show PROCEDURE status where definer='root@localhost'-- @localhost为用户登录位置(本地登录)

-- 查看指定时间段创建存储过程

show PROCEDURE status where created between '2017-02-17 00:00:00'

and '2017-02-17 23:59:59'

用系统表mysql.proc来查看:

-- 查看所有的存储过程信息

select * from mysql.proc

-- 查看特定数据库里的存储过程

select * from mysql.proc where db='test'

-- 查看某个用户定义的存储过程

select * from mysql.proc where definer='root@localhost'

-- 查看某时间段创建的存储过程

select * from mysql.proc where created between '2017-02-17 00:00:00'

and '2017-02-17 23:59:59'


欢迎分享,转载请注明来源:内存溢出

原文地址: http://www.outofmemory.cn/zaji/5916706.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-03-08
下一篇 2023-03-08

发表评论

登录后才能评论

评论列表(0条)

保存